我是靠谱客的博主 秀丽白猫,最近开发中收集的这篇文章主要介绍【转】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

最后

以上就是秀丽白猫为你收集整理的【转】Jedis常见异常汇总的全部内容,希望文章能够帮你解决【转】Jedis常见异常汇总所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(89)

评论列表共有 0 条评论

立即
投稿
返回
顶部