在Springboot下使用Netty并引入redis后@Scheduled定时任务抛NoSuchMethodError异常

在Springboot下使用Netty并引入redis后@Scheduled定时任务抛NoSuchMethodError异常_第1张图片

原因:

Springboot版本为2.1.3.RELEASE, Netty版本为4.1.50.Final, 引入spring-boot-starter-data-redis依赖后, 因为其中也有Netty依赖, 但是版本只有4.1.33, 因而版本冲突导致异常

解决方法:

1. 将Springboot版本改为2.2.6.RELEASE
2. 或将Netty版本改为4.1.33.Final
<parent>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-starter-parentartifactId>
     <version>2.2.6.RELEASEversion>
parent>

你可能感兴趣的:(问题解决,spring,boot,netty,redis)