首先应该明白报这个错误说明了你用的jedis方法与redis服务器中存储数据的类型存在冲突。

例如:数据库中有一个key的数据存储的是Hash类型的,但是你使用jedis执行数据操作的时候却使用了非Hash的操作方法。此时就会报

WRONGTYPE Operation against a key holding the wrong kind of value这个错误!

问题解决:

先执行一条如下命令:

redis 127.0.0.1:6379>type key

此时会显示出该key存储在现在redis服务器中的类型,例如:

redis 127.0.0.1:6379>hash

则表示key为以hash类型存储在redis服务器里的,此时操作这个数据就必须使用hset、hget等操作方法。

如果是zset如下:

redis 127.0.0.1:6379>zset

则表示数据类型为Sorted Sets的。此时就需要使用zadd、zrange等操作方法,否则就会报WRONGTYPE Operation against a key holding the wrong kind of value这个错误!

Redis报错:WRONGTYPE Operation against a key holding the wrong kind of value 解决处理的更多相关文章

  1. Redis发生异常WRONGTYPE Operation against a key holding the wrong kind of value

    Redis发生异常WRONGTYPE Operation against a key holding the wrong kind of value Redis发生异常WRONGTYPE Operat ...

  2. Redis:WRONGTYPE Operation against a key holding the wrong kind of value

    相关连接:通过Canal保证某网站的Redis与MySql的数据自动同步 1.错误信息 redis.clients.jedis.exceptions.JedisDataException: WRONG ...

  3. redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value

    错误原因: 因为redis中已经存在了相同的key, 而且key对应的值类型并不是Set,而是SortSet(改动前):再调用smembers时,抛出此错误. 解决方法: 将原来的的key给Del掉, ...

  4. Caused by: redis.clients.jedis.exceptions.JedisDataException: WRONGTYPE Operation against a key holding the wrong kind of value

    对错误类型key的操作,也就是说redis中没有你当前操作的这个key,而你用这个key去执行某些操作!检查key是否正确

  5. WRONGTYPE Operation against a key holding the wrong kind of value

    今天改动代码,一运行就跑错了,错误原因: 因为redis中已经存在了相同的key, 而且key对应的值类型并不是Set,而是SortSet(改动前):再调用smembers时,抛出此错误. 解决方法: ...

  6. redis 报Operation against a key holding the wrong kind of value警告的解决方法

    WRONGTYPE Operation against a key holding the wrong kind of value github:https://github.com/antirez/ ...

  7. filebeat output redis 报错 i/o timeout

    filebeat output  redis 报错 i/o timeout 先把报错内容贴出来. ERROR redis/client. go: Failed to RPUSH to redis li ...

  8. mac brew install redis 报错

    mac brew install redis 报错 /usr/local/opt/php55/bin/phpize /usr/local/opt/php55/bin/phpize: line 61: ...

  9. redis报错Windows error 0x70(a large memory)

    redis报错Windows error 0x70 redis 嫌弃你内存不够了,就给你不开第二个实例. The Windows version of Redis allocates a large ...

随机推荐

  1. 用Rprofile文件配置打开时R的设置

    R中经常会使用一些命令,而且需要重复输入,非常麻烦.如果能够一打开R就直接使用会方便很多. 通过配置一个.Rprofile文件,可以达到我们的目的. 注:本文仅适用于Mac # 创建一个.Rprofi ...

  2. 基于Spring框架的Web应用开发笔记 - Outline

    Motivation 最近的工作涉及Web框架搭建,在了解公司原有采用框架基础上对Web开发技术栈做了一次升级,在次做记录. Audience J2EE Web Application Develop ...

  3. H5标签-canvas实现颜色拾取功能

    HTML5 <canvas> 标签是用于绘制图像,不过,<canvas> 元素本身并没有绘制能力(它仅仅是图形的容器),必须使用脚本(通常是 JS)来完成实际的绘图任务. &l ...

  4. code::blocks(版本10.05) 配置opencv2.4.3

    (1)首先下载opencv2.4.3, 解压缩到D:下: (2)配置code::blocks, 具体操作如下: 第一步, 配置compiler, 操作步骤为Settings  -> Compil ...

  5. indexOf()的用法

    indexOf()的用法:返回字符中indexof(string)中字串string在父串中首次出现的位置,从0开始!没有返回-1:方便判断和截取字符串! indexOf()定义和用法indexOf( ...

  6. System.Web.UI.ScriptManager.RegisterStartupScript(语句末尾加分号,不然可能会造成语句不执行)

    System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "testKey", &q ...

  7. 常用的phpstorm设置

    1.始终在项目编辑器中显示行号[Show line numbers],可以通过File->Setting->Editor->Appearance->Show line numb ...

  8. UVa 839 天平

    原题链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...

  9. Eclipse反编译插件jad安装

    下载jadClipse地址: 链接: http://pan.baidu.com/s/1kTN4TPd  提取码: 3fvd 将net.sf.jadclipse_3.3.0.jar拷贝到eclipse的 ...

  10. Java 23种设计模式全解析

    转自:http://blog.csdn.net/longyulu/article/details/9159589