Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Java Jedis WRONGTYPE Operation against a key holding the wrong kind of value

$
0
0

I am connecting redis server from my machine using java Jedis. I am trying to do sadd which is already provided by Jedis.

But I am getting an exception as

WRONGTYPE Operation against a key holding the wrong kind of value

Error trace

enter image description hereSample code

JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();jedisPoolConfig.setMaxTotal(120);Jedis j = new JedisPool(jedisPoolConfig, RedisDBConfig.HOST, RedisDBConfig.PORT, RedisDBConfig.TIMEOUT, RedisDBConfig.PASSWORD).getResource();    try{        Long result = j.sadd( key,values);        System.out.println("Result for keyName "+ key +" is "+result );    }catch (Exception ex1){        System.out.println(ex1.getMessage());        return false;    }finally {    }    return true;

Add more in this.j.set and j.map command is working fine.

Value which I trying to input isj.sadd("key", "val1", "val2);


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>