【转】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

猜你喜欢

转载自blog.csdn.net/luoyoub/article/details/82155194