ClassCastException occurs when I try to scan a large number of keys using opsForHash.scan() method. I am using Jedis 2.6.2 and I face this error only when the number of keys to be searched is large(~100,000). I have read solutions to this problem online and most of them are suggesting that the problem occurs due to connection pooling.
I am using Spring integration in my project and have set use-pool attribute as true(in JedisConnectionFactory) even though it is the default option. Since spring is supposed to manage the connections with redis, why am I still having this issue? Please suggest.
This is the Spring Configuration file I am using :