【转】Jedis常见异常汇总

【转载】Jedis常见异常汇总,总结的相当详细!!
Jedis虽然使用起来比较简单,但是如果不能根据使用场景设置合理的参数(例如连接池参数),不合理的使用一些功能(例如Lua和事务)也会产生很多问题,本文对这些问题逐个说明:

详细目录:
一、redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
二、redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream
三、redis.clients.jedis.exceptions.JedisDataException: ERR illegal address
四、redis.clients.jedis.exceptions.JedisDataException: ERR max number of clients reached
五、redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
六、redis.clients.jedis.exceptions.JedisDataException: NOAUTH Authentication required
七、redis.clients.jedis.exceptions.JedisDataException: EXECABORT Transaction discarded because of previous errors
八、java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.List
九、redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value
十、redis.clients.jedis.exceptions.JedisDataException: OOM command not allowed when used memory > ‘maxmemory’
十一、redis.clients.jedis.exceptions.JedisDataException: LOADING Redis is loading the dataset in memory
十二、redis.clients.jedis.exceptions.JedisDataException: BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.
十三、redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
十四、UNKILLABLE Sorry the script already executed write commands against the dataset. You can either wait the script termination or kill the server in a hard way using the SHUTDOWN NOSAVE command.
十五、java.lang.NoClassDefFoundError
十六、redis.clients.jedis.exceptions.JedisDataException: ERR unknown command
十七、redis.clients.jedis.exceptions.JedisDataException: Please close pipeline or multi block before calling this method.
十八、redis.clients.jedis.exceptions.JedisDataException: ERR command role not support for normal user.

详见:https://yq.aliyun.com/articles/236384?spm=a2c4e.11153940.blogcont236383.20.d17a1c96Lm3AHM#cc8

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值