spring boot redis和netty5.0.2冲突

在集成Spring Boot的Netty与Redis时遇到版本冲突问题,具体表现为引入netty5.0.2后,启动报错。错误源于lettuce(Redis客户端)依赖的netty4与项目中的netty5版本不兼容。尝试通过屏蔽lettuce或指定版本等方式解决,但导致Redis Bean注入失败。最终解决方案是将Netty版本降至与lettuce-core相同的netty4版本,以消除冲突。这虽解决了问题,但也意味着需要调整使用Netty5的代码实现。
摘要由CSDN通过智能技术生成

今天用spring boot集成netty时候,刚开始挺顺利的,但是在引入

   <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>

之后,一切都变的不美好了,启动的时候会出现如下错误

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    io.lettuce.core.resource.DefaultEventLoopGroupProvider.createEventLoopGroup(DefaultEventLoopGroupProvider.java:141)

The following method did not exist:

    io.netty.util.concurrent.DefaultEventExecutorGroup.<init>(ILjava/util/concurrent/ThreadFactory;)V

The method's class, io.netty.util.concurrent.DefaultEventExecutorGroup, is available from the following locations:

    jar:file:/C:/work/maven/mymaven/repo/io/netty/netty-all/5.0.0.Alpha2/netty-all-5.0.0.Alpha2.jar!/io/netty/util/concurrent/DefaultEventExecutorGroup.class
    
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值