z281654498 2016-10-06 03:07 采纳率: 0%
浏览 6541

jedis与springmvc 集成,JedisPoolConfig 找不到类异常

最近需要用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

对这问题百度各种搜,搜到国外一个哥们也出现了这种情况,但是没有人解答
有遇到过同样问题的兄弟或者能帮我指点一下的高手吗?
如果我有描述不周的地方请各位指出,我会再增加详尽描述
感激不尽

  • 写回答

3条回答

  • Levisoft 2016-10-08 02:36
    关注

    是不是少包了?用反编译工具看下那个包里面是否有redis.clients.jedis.JedisPoolConfig这个类

    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64