Redisson依赖冲突记录

前言:项目使用的springboot项目为2.7.X


依赖冲突一:springboot 与 redisson版本冲突

项目中依赖了 Lock4j,此为苞米豆开源的分布式锁组件

复制代码
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>lock4j-redisson-spring-boot-starter</artifactId>
    <version>${lock4j.version}</version>
</dependency>

用的当时Lock4j最新版本2.2.4,里面所依赖的是 redisson:redisson-spring-data-30 ,此版本对应springboot的是3.X,启动后报 NoClassDefFoundError, 找不到redisson某个类

解决方案:版本回退到2.2.4,其中引用的是 redisson:redisson-spring-data-23 ,适配成功

redisson-spring-data与Spring Boot version的版本对应关系


依赖冲突二:gateway 与 redisson依赖的包冲突

redisson中依赖了Web包

复制代码
<dependency>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-web</artifactId>
</dependency>

启动gateway时报错:

复制代码
Description:
Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway.

Action:
Please set spring.main.web-application-type=reactive or remove spring-boot-starter-web dependency.

问题所在:

解决方案:排除依赖

究其原因是:spring-boot-starter-web不支持非阻塞

相关推荐
v***59831 天前
redis 使用
数据库·redis·缓存
韩师学子--小倪1 天前
fastjson与gson的toString差异
java·json
Drawing stars1 天前
JAVA后端 前端 大模型应用 学习路线
java·前端·学习
nbsaas-boot1 天前
SQL Server 存储过程开发规范(公司内部模板)
java·服务器·数据库
行百里er1 天前
用 ThreadLocal + Deque 打造一个“线程专属的调用栈” —— Spring Insight 的上下文管理术
java·后端·架构
acaad1 天前
Redis下载与安装(Windows)
数据库·redis·缓存
玄〤1 天前
黑马点评中 VoucherOrderServiceImpl 实现类中的一人一单实现解析(单机部署)
java·数据库·redis·笔记·后端·mybatis·springboot
J_liaty1 天前
Spring Boot拦截器与过滤器深度解析
java·spring boot·后端·interceptor·filter
短剑重铸之日1 天前
《7天学会Redis》Day2 - 深入Redis数据结构与底层实现
数据结构·数据库·redis·后端
亲爱的非洲野猪1 天前
Java锁机制八股文
java·开发语言