当前位置: 代码迷 >> 综合 >> Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hse
  详细解决方案

Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hse

热度:84   发布时间:2024-01-25 09:59:46.0

报错:

Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR wrong number of arguments for 'hset' commandat redis.clients.jedis.Protocol.processError(Protocol.java:66)at redis.clients.jedis.Protocol.process(Protocol.java:73)at redis.clients.jedis.Protocol.read(Protocol.java:138)at redis.clients.jedis.Connection.getIntegerReply(Connection.java:191)at redis.clients.jedis.Jedis.zrem(Jedis.java:1440)at com.gamejelly.gong.global.dbs.service.GlobalJedisService$26.doInJedis(GlobalJedisService.java:750)at com.hadoit.game.common.framework.nosql.redis.JedisTemplate.execute(JedisTemplate.java:79)at com.gamejelly.gong.global.dbs.service.GlobalJedisService.delRedisKeys(GlobalJedisService.java:746)at com.gamejelly.gong.global.dbs.proxy.GlobalCommandProxy.delRedisKeys(GlobalCommandProxy.java:642)at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:606)at com.hadoit.game.engine.core.utils.method.MethodInvoationWrap.invoke(MethodInvoationWrap.java:63)

原因:

jedis.hset(key, map) 数组参数delkeys长度为0,即抛出该异常

扩展:
网上查到jedis还有很多方法都会抛出该异常,原因与此一致。jedis 不定长度参数方法都有这个问题,大家要注意一下~

  相关解决方案