2

Things work just fine when I use lettuce version 3.4.x; Looks like lettuce has changed a class contract when it updated to 4.1.x (from abstract class to an interface) and spring-data-redis 1.7.x is not aware of that. I get the following error:

BeanInstantiationException: Failed to instantiate
[org.springframework.data.redis.core.RedisKeyValueAdapter]: Constructor threw exception; 
nested exception is java.lang.IncompatibleClassChangeError: 
class org.springframework.data.redis.connection.lettuce.BytesRedisCodec has
interface com.lambdaworks.redis.codec.RedisCodec as super class 

Not sure if Spring data redis team is working on it? Or is there a workaround or suggestion that I can use to still keep at 4.1.x version of lettuce?

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-redis</artifactId>
        <version>1.7.0.RC1</version>
    </dependency>
    <dependency>
        <groupId>biz.paluch.redis</groupId>
        <artifactId>lettuce</artifactId>
        <version>4.1.1.Final</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <optional>true</optional>
    </dependency>
Kia
  • 43
  • 8
  • 2
    Spring Data Redis 1.x supports only the 3.x branch. With Spring Data Redis 1.7 you require lettuce Version 3.4.2. We plan to upgrade to lettuce 4.x with Spring Data Redis 2.0 but it will take a while (hopefully fall/winter) until we can provide a meaningful release. – mp911de Apr 08 '16 at 08:43
  • I did not find any version compatibility stated in spring-data-redis documentation. Thanks for the update! – Kia Apr 08 '16 at 13:15
  • 2
    `pom.xml` is the best source to check for the version the Spring Data module was compiled against. – mp911de Apr 08 '16 at 13:17

0 Answers0