redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool(示例代码

Posted parkdifferent

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool(示例代码相关的知识,希望对你有一定的参考价值。

  今天在链接redis时,遇到问题:

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

   Could not get a resource from the pool。

  

  redis的配置是:

  

    <bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
        <property name="maxTotal" value="150" />
        <property name="maxIdle" value="30" />
        <property name="minIdle" value="10" />
        <property name="maxWaitMillis" value="30000" />
        <property name="testOnBorrow" value="true" />
        <property name="testOnReturn" value="true" />
        <property name="testWhileIdle" value="true" />
    </bean>

  最后,把 

testOnBorrow的值改为 FALSE就可以了。

 

以上是关于redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool(示例代码的主要内容,如果未能解决你的问题,请参考以下文章