最近需要用redis和springmvc做集成,于是我根据网上的例子在现有框架上集成jedis
1.使用jedis-2.7.3.jar(已检查过没有重复包,”cvtrl+左键“可以找到该类)
2.现在框架中已经集成了memcached,shiro,mybaits(不知道是否有冲突)
3.建立了spring-context-redis.xml文件,文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<!-- 加载配置属性文件 -->
<context:property-placeholder ignore-unresolvable="true" location="classpath*:/redis.properties" />
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxIdle" value="300"/> <!--最大能够保持idel状态的对象数-->
<property name="maxTotal" value="60000"/><!--最大分配的对象数-->
<property name="testOnBorrow" value="true"/><!--当调用borrow Oject方法时,是否进行有效性检查-->
</bean>
<bean id="jedisPool" class="redis.clients.jedis.JedisPool">
<constructor-arg index="0" ref="jedisPoolConfig"/>
<constructor-arg index="1" value="${redis.host}"/>
<constructor-arg index="2" value="${redis.port}" type="int"/>
<constructor-arg index="3" value="${redis.timeout}" type="int"/>
<constructor-arg index="4" value="${redis.auth}"/>
</bean>
</beans>
运行后报错:
Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.JedisPoolConfig
对这问题百度各种搜,搜到国外一个哥们也出现了这种情况,但是没有人解答
有遇到过同样问题的兄弟或者能帮我指点一下的高手吗?
如果我有描述不周的地方请各位指出,我会再增加详尽描述
感激不尽