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

3,746 views
Skip to first unread message

yin wang

unread,
Dec 18, 2012, 9:07:14 AM12/18/12
to jedis...@googlegroups.com
暴风影音的哥们儿?


2012/12/18 湛伟春 <weichu...@gmail.com>
I use jedis 2.1.0 v, When i invoke getResource() show below error :
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
at redis.clients.util.Pool.getResource(Pool.java:22)
at redis.clients.util.Pool.getResource(Pool.java:22)
at com.baofeng.common.jedis.JedisManager.getResource(JedisManager.java:86)
at com.baofeng.common.jedis.JedisManager.getResource(JedisManager.java:86)
at com.baofeng.common.jedis.JedisQueueManager.getElementFromQueue(JedisQueueManager.java:165)
at com.baofeng.common.jedis.JedisQueueManager.getElementFromQueue(JedisQueueManager.java:165)
at com.baofeng.common.service.MsgControlCenter.recvNodeStatus(MsgControlCenter.java:108)
at com.baofeng.common.service.MsgControlCenter.recvNodeStatus(MsgControlCenter.java:108)
at com.baofeng.ccs.jobs.WnStateCheckJob.execute(WnStateCheckJob.java:60)
at com.baofeng.ccs.jobs.WnStateCheckJob.execute(WnStateCheckJob.java:60)
at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:548)
Caused by: java.util.NoSuchElementException: Could not create a validated object, cause: ValidateObject failed

my configs:
REDIS_POOL_MAX_ACTIVE=500
REDIS_POOL_MIN_IDLE=200
REDIS_POOL_MAX_IDLE=400
REDIS_POOL_MAX_WAIT=1000
my code:
Jedis jedis = null;
        try {
            jedis = jedisPool.getResource();
            // do something..............
        } catch (Exception e) {
            log.error("Failed to get jedis resource, reason is :" + e.getMessage());
        } finally{
       jedisPool.returnResource(jedis);
}
        return jedis;

my configs MAX_ACTIVE = 500, why have above error message, please help me. thanks..


Sam Hendley

unread,
Dec 18, 2012, 10:08:30 AM12/18/12
to jedis...@googlegroups.com
Are you able to get any resources from pool? Does it fail like this on the first attempt or on the 500th?

It looks like someone else has had this issue:


Sam

Jonathan Leibiusky

unread,
Dec 18, 2012, 10:11:32 AM12/18/12
to jedis...@googlegroups.com
It says that ValidateObject failed. Validation in executing a PING command to redis. So if it fails, it means the PING command didn't get a PONG response, either because it got something else or the connection failed.

I would say that it seems like a connection issue. As Sam asked, does it happen on the first attempt or the 500th?
Reply all
Reply to author
Forward
0 new messages