天天看点

关于RocketMQMessageChannelBinder.java:172报错method that does not exist

关于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如下(未更改):

关于RocketMQMessageChannelBinder.java:172报错method that does not exist

错误信息可知getChannelInterceptors()报错:

关于RocketMQMessageChannelBinder.java:172报错method that does not exist

可知由于spring-integration-core-5.3.2.RELEASE.jar报错导致:

关于RocketMQMessageChannelBinder.java:172报错method that does not exist

官网找一下:

https://github.com/alibaba/spring-cloud-alibaba/pull/1503(无奈)

关于RocketMQMessageChannelBinder.java:172报错method that does not exist

问题解决:

由于轻易更改版本太容易出错了,那我们干脆换回来呗,查看下之前的版本中spring-integration-core版本为5.2.1:

更改pom:

关于RocketMQMessageChannelBinder.java:172报错method that does not exist

查看RocketMQMessageChannelBinder 173行已经不报红了。

建议:轻易别换版本尤其是使用 com.alibaba.cloud,如果业务需要确实需要比如我这次的nacos的权限问题,建议多去官网看下。

转载注明出处,谢谢。

继续阅读