项目无法从jedis池获取空闲对象,但redis服务器正在运行,还有很多空闲连接,它很长时间困惑

时间:2016-04-05 03:18:36

标签: java spring-data-redis

我的项目抛出的例外情况如下。

enter image description here

我检查我的redis服务器以显示客户端状态,我发现了。

enter image description here

spring配置就是那个

    <bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig" >
         <property name="maxIdle" value="10" />
         <property name="maxTotal" value="20" />
         <property name="testOnBorrow" value="true" />
         <property name="maxWaitMillis" value="6000" />
    </bean>


    <bean id="connectionFactory"
    class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
        p:host-name="192.168.5.52" p:port="6380" p:password="szwgmf"
        p:pool-config-ref="poolConfig" 
        p:database="3"/>
<bean id="stringSerializer"
    class="org.springframework.data.redis.serializer.StringRedisSerializer" />

<bean id="redisTemplate"     class="org.springframework.data.redis.core.RedisTemplate">
        <property name="connectionFactory" ref="connectionFactory" />
        <property name="keySerializer" ref="stringSerializer" />
        <property name="valueSerializer" ref="stringSerializer" />
        <property name="enableTransactionSupport" value="true" />
    </bean>

pom.xml是

<dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>1.6.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.8.1</version>
        </dependency>

0 个答案:

没有答案