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

分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow

也欢迎大家转载本篇文章。分享知识,造福人民,实现我们中华民族伟大复兴!

                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 reportmessage Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pooldescription The server encountered an internal error that prevented it from fulfilling this request.exceptionorg.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 causeredis.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 causeredis.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 causejava.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; 

           

给我老师的人工智能教程打call!http://blog.csdn.net/jiangjunshow
这里写图片描述
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
报错“Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException”是由于在调试代码时无法获取Jedis连接引起的。 解决这个问题的方法是确保已正确配置了Redis连接信息,并且Redis服务器正常运行。您可以检查以下几点: 1. 确保已正确导入了Jedis相关的jar包,如jedis-2.4.1.jar、redis.clients-3.0.1.jar、jedis-3.0.0.jar。 2. 检查您的代码中是否正确地创建了Jedis连接池,并指定了正确的Redis服务器地址和端口。 3. 检查您的代码中是否正确地获取Jedis连接并执行相关操作之前,已经初始化了连接池。 4. 如果您的代码中使用了缓存配置,如<***请确保已正确配置了缓存 eviction 和 type 属性。 如果您已经检查过上述内容并确认没有问题,您还可以尝试以下步骤来解决这个问题: 1. 检查您的网络连接是否正常,尝试重新连接Redis服务器。 2. 检查Redis服务器的运行状态,确保Redis服务器已正常启动并且没有其他配置或权限问题。 3. 检查Redis服务器的配置文件,如redis.conf,确保没有限制连接数或其他相关设置。 通过以上步骤,您应该能够解决报错“Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException”的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [redis使用问题一:Cannot get Jedis ... nested exception is redis.clients.jedis.exceptions.JedisExce...](https://blog.csdn.net/denghe4720/article/details/101362329)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [jedis-2.4.1.jar、redis.clients-3.0.1.jar、jedis-3.0.0.jar](https://download.csdn.net/download/a284835492/86796955)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值