redis JedisConnectionException: Could not get a resource from the pool

HTTP Status 500 - Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

type Exception report

message Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:97)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:143)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:41)
	org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:177)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152)
	org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84)
	org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:43)
	org.springframework.data.redis.core.DefaultBoundValueOperations.get(DefaultBoundValueOperations.java:41)
	com.auth.provider.impl.DefaultRememberMeProvider.findRememberMeById(DefaultRememberMeProvider.java:47)
	com.auth.AbstractSessionManager.getRememberMe(AbstractSessionManager.java:254)
	com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:84)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
root cause

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
	redis.clients.util.Pool.getResource(Pool.java:42)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:90)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:143)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:41)
	org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:177)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152)
	org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84)
	org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:43)
	org.springframework.data.redis.core.DefaultBoundValueOperations.get(DefaultBoundValueOperations.java:41)
	com.auth.provider.impl.DefaultRememberMeProvider.findRememberMeById(DefaultRememberMeProvider.java:47)
	com.auth.AbstractSessionManager.getRememberMe(AbstractSessionManager.java:254)
	com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:84)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
root cause

redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect
	redis.clients.jedis.Connection.connect(Connection.java:142)
	redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)
	redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1724)
	redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:65)
	org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:836)
	org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:434)
	org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:361)
	redis.clients.util.Pool.getResource(Pool.java:40)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:90)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:143)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:41)
	org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:177)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152)
	org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84)
	org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:43)
	org.springframework.data.redis.core.DefaultBoundValueOperations.get(DefaultBoundValueOperations.java:41)
	com.auth.provider.impl.DefaultRememberMeProvider.findRememberMeById(DefaultRememberMeProvider.java:47)
	com.auth.AbstractSessionManager.getRememberMe(AbstractSessionManager.java:254)
	com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:84)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
root cause

java.net.ConnectException: Connection refused: connect
	java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
	java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	java.net.PlainSocketImpl.connect(Unknown Source)
	java.net.SocksSocketImpl.connect(Unknown Source)
	java.net.Socket.connect(Unknown Source)
	redis.clients.jedis.Connection.connect(Connection.java:137)
	redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)
	redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1724)
	redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:65)
	org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:836)
	org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:434)
	org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:361)
	redis.clients.util.Pool.getResource(Pool.java:40)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:90)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:143)
	org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:41)
	org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)
	org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:177)
	org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152)
	org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84)
	org.springframework.data.redis.core.DefaultValueOperations.get(DefaultValueOperations.java:43)
	org.springframework.data.redis.core.DefaultBoundValueOperations.get(DefaultBoundValueOperations.java:41)
	com.auth.provider.impl.DefaultRememberMeProvider.findRememberMeById(DefaultRememberMeProvider.java:47)
	com.auth.AbstractSessionManager.getRememberMe(AbstractSessionManager.java:254)
	com.auth.filter.AuthenticationFilter.doFilterInternal(AuthenticationFilter.java:84)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
	org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
	org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.54 logs.

Apache Tomcat/7.0.54

产生此错误的原因通常是Redis没有启动,或者是由于防火墙等原因无法连接到Redis;

时间: 2024-08-07 01:17:45

redis JedisConnectionException: Could not get a resource from the pool的相关文章

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&qu

【Redis】Could not get a resource from the pool 实乃集群配置问题

先说些题外话~自上次确诊为鼻窦炎+过敏性鼻炎到现在已经一个月了,最初那会,从下午到晚上头疼难忍.大概是积劳成疾,以前流鼻涕.打喷嚏的时候从来没有注意过,结果病根一下爆发. 关键在于锁定问题,开始治疗一两天之后就不会头疼了.当然,习惯也很重要,再也不敢用力擤鼻子了. 挺过那一阵就好受很多,之后就是鼻塞稍微烦人一些.鼻子的问题很容易串到其他面部器官中去,一旦发展严重必然大幅度影响生活质量. 治疗方法推荐洗鼻(前两周先消炎,吃地红霉素),但注意不要让医院赚的太狠,药包到药店或者网上买都可以:如果是过敏

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

启动项目报该异常.原因是因为该项目是需要启动redis的,报错原因是因为没有安装redis或者没有手动启动redis,把redis设置成自启动就行了 一.下载windows版本的Redis 官网下载地址:http://redis.io/download github下载地址:https://github.com/MSOpenTech/redis/tags 二.安装Redis 1.这里下载的是Redis-x64-3.2.100版本,我的电脑是win7 64位,所以下载64位版本的,在运行中输入cm

jedis 连接 redis:Could not get a resource from the pool——我的出错原因和解决办法

windows 下安装的,本机使用 现象:刚装好开发使用好好的, 重启电脑后就报这个错 网上的所有可能都试过,没有用. 最后,放弃所有包装,用最原始的代码进行连接测试: Jedis jedis=new Jedis("127.0.0.1"); jedis.auth("7777");//password jedis.set("firstKey", "hello redis!"); ERR Client sent AUTH, but

开发手记:JedisConnectionException: Could not get a resource from the pool

对于Redis,生产环境是集群模式,测试环境是单例模式,如果在生产环境中用单例模式会报错. 解决办法,通过云配置,将配置进行自动化配置. 另附一份Redis配置: #*********************Redis单节点配置************************ # Redis服务器地址 spring.redis.host=10.5.172.67 # Redis服务器连接端口 spring.redis.port=7006 #*********************RedisClu

Redis一个异常的解决办法,异常描述:Could not get a resource from the pool

异常描述: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at redis.clients.util.Pool.getResource(Pool.java:22) at com.derbysoft.jredis.longkeytest.BorrowObject.run(BorrowObject.java:22) at java.lang.Thread.

java 连接 redis集群时报错:Could not get a resource from the pool

由于弄这个的时候浪费了太多的时间,所以才记录下这个错,给大伙参考下 检查了一下,配置啥的都没问题的,但在redis集群机器上就可以,错误如下: Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool 原因: 是因为我在创集群的时候的ip地址是:127.0.0.1,不是本机的电脑访问的话是不能访问的,

Redis2.1.0:Could not get a resource from the pool的分析

节前的最后一天,sso登陆出现问题,多数用户无法正常登陆.经查询日志,报错如下: 错误日志截取如下2015-02-15 08:40:30,536 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <com.gaochao.oa.module.sso.authentication.handler.FxLdapMixAuthenticationHandler successfully authenticated[usern

Could not get a resource from the pool

异常描述: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool   at redis.clients.util.Pool.getResource(Pool.java:22)   at com.derbysoft.jredis.longkeytest.BorrowObject.run(BorrowObject.java:22)   at java.lang.T