Could not get a resource from the pool

Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

at redis.clients.util.Pool.getResource(Pool.java:50)

at redis.clients.jedis.JedisPool.getResource(JedisPool.java:86)

at com.jfinal.plugin.redis.Cache.getJedis(Cache.java:1257)

at com.jfinal.plugin.redis.Cache.get(Cache.java:89)

at com.jfinal.weixin.sdk.cache.RedisAccessTokenCache.get(RedisAccessTokenCache.java:26)

at com.jfinal.weixin.sdk.api.AccessTokenApi.getAccessToken(AccessTokenApi.java:42)

at com.jfinal.weixin.sdk.api.AccessTokenApiTest.test(AccessTokenApiTest.java:36)

at com.jfinal.weixin.sdk.api.AccessTokenApiTest.main(AccessTokenApiTest.java:26)

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect

at redis.clients.jedis.Connection.connect(Connection.java:155)

at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:83)

at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1643)

at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:85)

at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:861)

at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)

at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)

at redis.clients.util.Pool.getResource(Pool.java:48)

... 7 more

Caused by: java.net.ConnectException: Connection refused: connect

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:149)

... 14 more


评论区

xfxioun

2016-08-15 11:17

AccessTokenApiTest 运行总是链接不上是什么原因,感觉没有获取到accessToken

JFinal

2016-08-15 11:19

这个是在连接 redis,你确定你安装并配置好了 redis 环境?

xfxioun

2016-08-15 11:24

詹总,redis需要单独配置么,没用过redis,能指示一下么?谢谢

热门反馈

扫码入社