HTTP Status 500 - Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.Je

本文涉及的产品
云数据库 Tair(兼容Redis),内存型 2GB
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: HTTP Status 500 - Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource...
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; 

相关实践学习
基于Redis实现在线游戏积分排行榜
本场景将介绍如何基于Redis数据库实现在线游戏中的游戏玩家积分排行榜功能。
云数据库 Redis 版使用教程
云数据库Redis版是兼容Redis协议标准的、提供持久化的内存数据库服务,基于高可靠双机热备架构及可无缝扩展的集群架构,满足高读写性能场景及容量需弹性变配的业务需求。 产品详情:https://www.aliyun.com/product/kvstore     ------------------------------------------------------------------------- 阿里云数据库体验:数据库上云实战 开发者云会免费提供一台带自建MySQL的源数据库 ECS 实例和一台目标数据库 RDS实例。跟着指引,您可以一步步实现将ECS自建数据库迁移到目标数据库RDS。 点击下方链接,领取免费ECS&RDS资源,30分钟完成数据库上云实战!https://developer.aliyun.com/adc/scenario/51eefbd1894e42f6bb9acacadd3f9121?spm=a2c6h.13788135.J_3257954370.9.4ba85f24utseFl
目录
相关文章
|
3月前
|
NoSQL Unix 网络安全
【Azure Cache for Redis】Python Django-Redis连接Azure Redis服务遇上(104, 'Connection reset by peer')
【Azure Cache for Redis】Python Django-Redis连接Azure Redis服务遇上(104, 'Connection reset by peer')
【Azure Cache for Redis】Python Django-Redis连接Azure Redis服务遇上(104, 'Connection reset by peer')
|
2月前
|
NoSQL 安全 Java
解决Unknown redis exception及event executor terminated错误的方法
解决这类问题时,保持耐心和细致是关键。通常,通过系统地检查和排除潜在原因,大多数问题最终都能被解决。
305 1
|
3月前
|
NoSQL 安全 网络安全
【Azure Redis】PHPRedis遇见SSL Connection Timeout问题
【Azure Redis】PHPRedis遇见SSL Connection Timeout问题
【Azure Redis】PHPRedis遇见SSL Connection Timeout问题
|
3月前
|
NoSQL 数据可视化 Linux
2022 年超详细步骤讲解 CentOS 7 安装Redis 。解决Redis Desktop Manager 图形化工具连接失败解决 ;connection failed处理。开机自启Redis
这篇文章提供了在CentOS 7上安装Redis的详细步骤,包括上传Redis安装包、解压安装、编译、安装、备份配置文件、修改配置以支持后台运行和设置密码、启动Redis服务、使用客户端连接Redis、关闭Redis服务、解决Redis Desktop Manager图形化工具连接失败的问题、设置Redis开机自启动,以及Redis服务的启动和停止命令。
2022 年超详细步骤讲解 CentOS 7 安装Redis 。解决Redis Desktop Manager 图形化工具连接失败解决 ;connection failed处理。开机自启Redis
|
3月前
|
iOS开发 MacOS Python
【Mac 系统】解决已有清华镜像但出现CondaHTTPError: HTTP 000 CONNECTION FAILED for url
在尝试使用清华镜像创建conda环境时遇到下载超时问题,通过删除原有镜像并添加针对Mac OS的清华镜像解决了该问题。
109 3
|
3月前
|
缓存 NoSQL Linux
【Azure Redis 缓存】应用中出现连接Redis服务错误(production.ERROR: Connection refused)的排查步骤
【Azure Redis 缓存】应用中出现连接Redis服务错误(production.ERROR: Connection refused)的排查步骤
|
3月前
|
缓存 NoSQL 网络安全
【Azure Redis 缓存】 Python连接Azure Redis, 使用redis.ConnectionPool 出现 "ConnectionResetError: [Errno 104] Connection reset by peer"
【Azure Redis 缓存】 Python连接Azure Redis, 使用redis.ConnectionPool 出现 "ConnectionResetError: [Errno 104] Connection reset by peer"
|
3月前
|
缓存 NoSQL Redis
【Azure Redis 缓存】Azure Cache for Redis 是否记录具体读/写(Get/Set)或删除(Del)了哪些key呢?
【Azure Redis 缓存】Azure Cache for Redis 是否记录具体读/写(Get/Set)或删除(Del)了哪些key呢?
|
3月前
|
NoSQL 网络协议 Shell
【Azure 应用服务】App Service 项目部署成功后,应用连接 Azure Redis时报错 Could not get a resource from the pool
【Azure 应用服务】App Service 项目部署成功后,应用连接 Azure Redis时报错 Could not get a resource from the pool
|
3月前
|
缓存 NoSQL Java
【Azure Redis 缓存】云服务Worker Role中调用StackExchange.Redis,遇见莫名异常(RedisConnectionException: UnableToConnect on xxx 或 No connection is available to service this operation: xxx)
【Azure Redis 缓存】云服务Worker Role中调用StackExchange.Redis,遇见莫名异常(RedisConnectionException: UnableToConnect on xxx 或 No connection is available to service this operation: xxx)

热门文章

最新文章