redis:java.util.NoSuchElementException: Unable to validate object

Posted fj_yin

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redis:java.util.NoSuchElementException: Unable to validate object相关的知识,希望对你有一定的参考价值。

redis.clients.jedis.exceptions.JedisException: Could not get a resource from the pool
    at redis.clients.util.Pool.getResource(Pool.java:51)
    at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)
    at redis.clients.jedis.JedisClusterInfoCache.renewClusterSlots(JedisClusterInfoCache.java:103)
    at redis.clients.jedis.JedisClusterConnectionHandler.renewSlotCache(JedisClusterConnectionHandler.java:52)
    at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:135)
    at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:141)
    at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:141)
    at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:141)
    at redis.clients.jedis.JedisClusterCommand.runWithRetries(JedisClusterCommand.java:141)
    at redis.clients.jedis.JedisClusterCommand.runBinary(JedisClusterCommand.java:60)
    at redis.clients.jedis.BinaryJedisCluster.get(BinaryJedisCluster.java:98)
    at com.sinosig.components.redis.server.RedisCacheManager.getObj(RedisCacheManager.java:27)
    at com.sinosig.components.redis.server.RedisCacheManager.main(RedisCacheManager.java:37)
Caused by: java.util.NoSuchElementException: Unable to validate object
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:506)
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
    at redis.clients.util.Pool.getResource(Pool.java:49)
    ... 12 more
null

 客户端能ping通

发现问题

本地代码获取ip为127.0.0.1,既redis集群不对外发布,注意创建集群时指定ip而不是127.0.0.1(即时你是伪集群)

 一个疏忽的错误吧,大家注意一下

 

以上是关于redis:java.util.NoSuchElementException: Unable to validate object的主要内容,如果未能解决你的问题,请参考以下文章

redis启动,停止

redis演练聚集

windows 怎么开启redis

redis如何执行redis命令

Redis学习——详解Redis配置文件

Redis 基础 -- Redis简介CentOS 7 单机安装Redis启动Redis(后台启动Redis 指定配置文件启动Redis 开机自启Redis )Redis客户端(含图形化界面)