Redisson依赖冲突记录
- 软件开发
- 2025-07-21 18:58:36

前言:项目使用的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不支持非阻塞
Redisson依赖冲突记录由讯客互联软件开发栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“Redisson依赖冲突记录”