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

解决办法:调整JedisPoolConfig中maxActive为适合自己系统的阀值。

<bean id="dataJedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig"> 
        <property name="maxActive" value="300"/> 
        <property name="maxIdle" value="100"/> 
        <property name="maxWait" value="10000"/> 
        <property name="testOnBorrow" value="true"/> 
</bean> 

参考:https://www.iteye.com/topic/1122212



 注:其它原因备录:

  • Jedis 对象用完以后,要释放掉,不让会一直占用,所以会出现无法获取新的资源。
  • 由于防火墙原因无法连接到Redis
  • IP地址或端口错误(端口未开放)
原文地址:https://www.cnblogs.com/LJing21/p/11526952.html