Skip to content

Why Getting NoClassDefFound error for JedisConnection when using Spring Redis

Hello when trying to use spring-redis i am getting

java.lang.NoClassDefFoundError: Could not initialize class

exception when doing any connection operation using redis. My config method goes like this

public RedisConnectionFactory jedisConnFactory() {
    JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory();


    return jedisConnectionFactory;

Please suggest if anyone knows why i am getting this exception.


After wasting almost one day and finding that the jar is already on my class path, i further debugged it and found that when java’s reflection mechanism was trying to find a method which was already present in the “methods list” it was not able to find due to some version conflict between Jedis version (2.7.2) not compatible with Spring Data Redis (1.5.0.RELEASE) , this issue has already been answered in this link ::
Jedis and spring data redis version conflict