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不支持非阻塞

相关推荐
Sarvartha2 小时前
final 关键字
java·开发语言
2601_952047792 小时前
单一策略深度教程:用轻易云把集成任务的报错实时推送到钉钉机器人
java·机器人·钉钉
数据狐(Datafox)2 小时前
淘宝图片搜索 API 落地实战:基于以图搜货搭建跨境电商选品系统
java·大数据·微服务
禾小西4 小时前
Redis:从两大维度和三大主线建立知识体系
数据库·redis·缓存
Escalating_xu4 小时前
【C 语言】数据在内存中的存储:补码、大小端、整型陷阱与 IEEE 754 全解析
java·c语言·网络
灯澜忆梦4 小时前
【面向对象编程C++】| 基础语法
java·c++·算法
禾小西5 小时前
Redis 数据结构:快速的 Redis 有哪些慢操作?
数据结构·数据库·redis
一个风轻云淡5 小时前
GCC 和 GDB命令简单解读
java·linux·前端