问题描述
- JedisConnectionException:Could not get a resource
- 前辈们,您们好:
硬件:win7 64bit webloginc 10.3 (32bit)/java 1.6(安装weblogic使用的自带Java版本)
我使用weblogic部署wap环境后登录(在进入debug之前就会异常),就会出现“不能从连接池获取资源”异常具体如下:
at redis.clients.util.Pool.getResource(Pool.java:22)
at com.ai.log.util.redis.RedisManager.getJedis(RedisManager.java:64)
at com.ai.log.client.RedisLogAppend.getJedis(RedisLogAppend.java:87)
at com.ai.log.client.RedisLogAppend.append(RedisLogAppend.java:48)
at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221)
at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57)
at org.apache.log4j.Category.callAppenders(Category.java:187)
at org.apache.log4j.Category.forcedLog(Category.java:372)
at org.apache.log4j.Category.error(Category.java:286)
……(此处省略更多行)
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
at redis.clients.jedis.Connection.connect(Connection.java:134)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:69)
at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1665)
at redis.clients.jedis.JedisPool$JedisFactory.makeObject(JedisPool.java:72)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)
at redis.clients.util.Pool.getResource(Pool.java:20)
... 79 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at redis.clients.jedis.Connection.connect(Connection.java:129)
... 84 more
我使用过的方法:1、更改redis.properties配置(非-1、大数字也试过)
MaxActive=-1
MaxIdle=-1
MaxWait=10000
2、试过安装官网通用版weblogic 10.X;
3、考虑更换Tomcat部署,但是配置文件太多(15个),不知道如何部署。
发梢挠到后脑勺,异常坚强如磐石。
解决方案
HTTP Status 500 - Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pooltype Exception report
message Cannot ......
答案就在这里:redis JedisConnectionException: Could not get a resource from the pool
时间: 2024-10-24 17:07:57