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

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 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?