最近在切换数据库的时候,突然发现项目无法启动.错误信息如下:
Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for ‘hmset’ command
at redis.clients.jedis.Protocol.processError(Protocol.java:127)
at redis.clients.jedis.Protocol.process(Protocol.java:161)
at redis.clients.jedis.Protocol.read(Protocol.java:215)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340)
at redis.clients.jedis.Connection.getAll(Connection.java:310)
at redis.clients.jedis.Connection.getAll(Connection.java:302)
at redis.clients.jedis.Pipeline.sync(Pipeline.java:99)
at org.springframework.data.redis.connection.jedis.JedisConnection.convertPipelineResults(JedisConnection.java:368)
… 26 common frames omitted
经过排查,发现是数据库中的字典表不知道怎么被清空了,导致空对象写入hash中.
初始化之后问题不在出现.顺带添加了兼容代码.