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

RedisTemplate nullPointException

$
0
0

I am working with jedis and redisTemplate library but when I declare hashoperations hashOps and trying to get values, I came up with NullPointExteption.

      RedisTemplate<String, String> redisTemplate2 = new RedisTemplate<>();      JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();      jedisConnectionFactory.setUsePool(true);      jedisConnectionFactory.setHostName("100.100.101.102");      jedisConnectionFactory.setPort(9999);        redisTemplate2.setConnectionFactory(jedisConnectionFactory);      redisTemplate2.setDefaultSerializer(new StringRedisSerializer());      System.out.println(redisTemplate2);       HashOperations<String, String, String>  hashOps = redisTemplate2.opsForHash();       List<String> result = hashOps.values("chat_content:"); 

On the last line I got Null Exception. Neither redisTemplate nor jedisConnectionFactory are empty. Am I missed Something??? Any help would be thanks


Viewing all articles
Browse latest Browse all 2204

Trending Articles



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