spring-boot-starter-data-redis和redisson-spring-boot-starter一起使用:ideaj运行不报错,打包后运行报错

spring:
  redis:
    host: 192.168.110.16
    port: 16379
    timeout: 6000
    jedis:
      pool:
        max-active: 500
        max-wait: -1
        max-idle: 10
        min-idle: 1
    redisson:
      config:
        singleServerConfig:
        address: redis://192.168.110.16:16379
        database: 1
上图yml配置

pom.xml部分配置


    org.springframework.boot
    spring-boot-starter-parent
    2.1.1.RELEASE


    org.springframework.boot
    spring-boot-starter-data-redis
    runtime


    org.redisson
    redisson-spring-boot-starter
    3.17.7
    
        
            org.redisson
            redisson-spring-data-26
        

报错spring-boot-starter-data-redis和redisson-spring-boot-starter一起使用:ideaj运行不报错,打包后运行报错_第1张图片

nested exception is java.lang.NoClassDefFoundError: org/springframework/data/redis/connection/RedisStreamCommands

查询各种资料,最终找到原因:版本spring boot  和 redsson中的redisson-spring-data

对应关系问题

spring-boot-starter-data-redis和redisson-spring-boot-starter一起使用:ideaj运行不报错,打包后运行报错_第2张图片

 所以解决办法,maven repository  里面也有说明


    org.redisson
    redisson-spring-boot-starter
    3.17.7
    
        
            org.redisson
            redisson-spring-data-26
        

    org.redisson
    redisson-spring-data-21
    3.17.7

你可能感兴趣的:(redis,springboot,redis,数据库)