關于RocketMQMessageChannelBinder.java:172報錯method that does not exist
背景:
為了适配nacos1.3.2,springcloud由Hoxton.RELEASE更新到Hoxton.SR7,com.alibaba.cloud****2.2.0更新到2.2.1
問題描述:
錯誤資訊如下:
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.alibaba.cloud.stream.binder.rocketmq.RocketMQMessageChannelBinder.createProducerMessageHandler(RocketMQMessageChannelBinder.java:172)
The following method did not exist:
org.springframework.integration.channel.AbstractMessageChannel.getChannelInterceptors()Ljava/util/List;
The method's class, org.springframework.integration.channel.AbstractMessageChannel, is available from the following locations:
jar:file:/xzb/5_course/xzb-course.jar!/BOOT-INF/lib/spring-integration-core-5.3.2.RELEASE.jar!/org/springframework/integration/channel/AbstractMessageChannel.class
The class hierarchy was loaded from the following locations:
org.springframework.integration.channel.AbstractMessageChannel: jar:file:/xzb/5_course/xzb-course.jar!/BOOT-INF/lib/spring-integration-core-5.3.2.RELEASE.jar!/
org.springframework.integration.context.IntegrationObjectSupport: jar:file:/xzb/5_course/xzb-course.jar!/BOOT-INF/lib/spring-integration-core-5.3.2.RELEASE.jar!/
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.integration.channel.AbstractMessageChannel
問題分析:
pom如下(未更改):

錯誤資訊可知getChannelInterceptors()報錯:
可知由于spring-integration-core-5.3.2.RELEASE.jar報錯導緻:
官網找一下:
https://github.com/alibaba/spring-cloud-alibaba/pull/1503(無奈)
問題解決:
由于輕易更改版本太容易出錯了,那我們幹脆換回來呗,檢視下之前的版本中spring-integration-core版本為5.2.1:
更改pom:
檢視RocketMQMessageChannelBinder 173行已經不報紅了。
建議:輕易别換版本尤其是使用 com.alibaba.cloud,如果業務需要确實需要比如我這次的nacos的權限問題,建議多去官網看下。
轉載注明出處,謝謝。