redis WRONGTYPE Operation against a key holding the wrong kind of value__redis

來源:互聯網
上載者:User
2018-04-27 15:01:50.141|ERROR|EvMessageListener|Receive MsgId:AC110006000D30F39991868BAA7BBF6B tag:1 status:ReconsumeLaterredis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of valueat redis.clients.jedis.Protocol.processError(Protocol.java:117)at redis.clients.jedis.Protocol.process(Protocol.java:151)at redis.clients.jedis.Protocol.read(Protocol.java:205)at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)at redis.clients.jedis.Connection.getIntegerReply(Connection.java:222)at redis.clients.jedis.Jedis.hset(Jedis.java:606)at com.extracme.evready.busi.service.ServiceMessage.updateStakeRedisInfo(ServiceMessage.java:233)at com.extracme.evready.busi.service.ServiceMessage.handerMessage(ServiceMessage.java:139)at com.extracme.evready.busi.service.ServiceMessage$$FastClassBySpringCGLIB$$63c3ab5e.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)^Cat org.springframework.transaction.interceptor.T
/** * 2:控制模式 - 自動下發補償機制 狀態的有效時間 */String key_expire = RedisCarportCloumn.MODE_EXPIRE_PREFIX + result.getGridStakeSeq();//jedis.hset(key_expire,CommonConstant.SEND_TIMES_KEY, CommonConstant.SEND_STAKE_MSG_TIMES);//限制主動下發次數jedis.hset(key_expire,"SEND_TIMES","3");//限制主動下發次數//jedisCluster.hset(key_expire,CommonConstant.SEND_TIMES_KEY, CommonConstant.SEND_STAKE_MSG_TIMES);//限制主動下發次數}jedis.close();

hset看起來沒有實值型別不對的樣子。後來發現原來是因為redis資料庫中已經存在了相同的key, 而且key對應的實值型別並不是Hashkey;再調用hset時,就會拋出此錯誤。(ps:忽想起來,最初設定的key-val   ,後面改為hash-val)

把原來的資料清掉,重新運行就沒問題了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.