首页 > 解决方案 > org.springframework.messaging.converter.AbstractMessageConverter。([Lorg/springframework/util/MimeType;)V Spring Cloud Stream

问题描述

当我简单地从以下位置运行代码时,我遇到了以下错误:https ://github.com/shacko-samples/s1p-2019-scst-kafka-talk/tree/master/hello-streams-application 。

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-03-05 11:29:56.783 ERROR 24712 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

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

    org.springframework.cloud.function.context.config.JsonMessageConverter.<init>(JsonMessageConverter.java:47)

The following method did not exist:

    org.springframework.messaging.converter.AbstractMessageConverter.<init>([Lorg/springframework/util/MimeType;)V

The method's class, org.springframework.messaging.converter.AbstractMessageConverter, is available from the following locations:

    jar:file:/C:/Users/user/.m2/repository/org/springframework/spring-messaging/5.2.0.RELEASE/spring-messaging-5.2.0.RELEASE.jar!/org/springframework/messaging/converter/AbstractMessageConverter.class

It was loaded from the following location:

    file:/C:/Users/user/.m2/repository/org/springframework/spring-messaging/5.2.0.RELEASE/spring-messaging-5.2.0.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.messaging.converter.AbstractMessageConverter

标签: spring-cloud-streamspring-cloud-stream-binder-kafka

解决方案


看起来您在类路径上的 spring-messaging 版本错误(不匹配)。该方法是在 Spring Framework 5.2.2 中添加的。

我看到该项目的 pom 正在使用快照。

我认为 Hoxton 在 SR5 前后从 Boot 2.2 切换到了 2.3。

在 pom 中,尝试将 Boot starter 更改为 2.3.9.RELEASE 并将 Hoxton 版本更改为Hoxton.SR10.

如果这不起作用,请尝试 Boot 2.2.13.RELEASE 和 Hoxton.SR4。


推荐阅读