首先应该明白报这个错误说明了你用的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. B3log部署文档

    https://github.com/b3log/solo/wiki/standalone_mode 独立模式 只要已经安装好了 Java 环境,一个命令就能启动! 不依赖 MySQL 数据库,而是使 ...

  2. archlinux安装图形界面

    安装xorg 检查显卡驱动 $ lspci | grep VGA install X server wiki Then use the $ startx to start the X server, ...

  3. 行为识别笔记:HOG,HOF与MBH特征(转载)

    在行为识别的iDT算法中,主要使用了HOG,HOF,MBH和Dense Trajectory四种特征.这里主要对前三者进行介绍. 1. HOG特征(histogram of gray) 此处HOG特征 ...

  4. css透明度的设置 (兼容所有浏览器)

    一句话搞定透明背景! .transparent_class { filter:alpha(opacity=); -moz-opacity:0.5; -khtml-opacity: 0.5; opaci ...

  5. c 函数及指针学习 9

    指针的高级应用 处理命令行参数 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 #include <stdio.h>   int main(int ar ...

  6. leetcode 151. Reverse Words in a String --------- java

    Given an input string, reverse the string word by word. For example,Given s = "the sky is blue& ...

  7. UVALive-4670 Dominating Patterns(AC自动机)

    题目大意:找出出现次数最多的模式串. 题目分析:AC自动机裸题. 代码如下: # include<iostream> # include<cstdio> # include&l ...

  8. c++关于接口机制和不完全类型的小问题

    都和typedef有关 一个是接口机制时用到的 就是所有用到接口的源文件只需包含简单的接口声明 接口的具体实现在其他源文件中实现 接口可以是 //interface.h typedef struct ...

  9. Linux dbg debugging

    http://h41379.www4.hpe.com/doc/84final/4538/4538pro_contents.html https://kgdb.wiki.kernel.org/index ...

  10. JAVA 线程池, 多线程

    http://tutorials.jenkov.com/java-util-concurrent/executorservice.html http://howtodoinjava.com/core- ...