SpringBoot整合SpringCloud中Bus消息总线组件版本不兼容问题
问题描述
今天早上小编满脸微笑的对待SpringCloud,可以在使用Bus 消息总线组件的时候,出现bug 了,我们大家来看一下。
2020-07-17 16:47:17.176 WARN 56956 --- [ main] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
java.net.Inet6AddressImpl.getHostByAddr(Native Method)
java.net.InetAddress$2.getHostByAddr(InetAddress.java:932)
java.net.InetAddress.getHostFromNameService(InetAddress.java:617)
java.net.InetAddress.getHostName(InetAddress.java:559)
java.net.InetAddress.getHostName(InetAddress.java:531)
org.springframework.cloud.commons.util.InetUtils$$Lambda$110/2051853139.call(Unknown Source)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:748)
2020-07-17 16:47:17.189 INFO 56956 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-07-17 16:47:17.195 ERROR 56956 --- [ 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:/E:/User_Data/Maven_Bank/org/springframework/spring-messaging/5.2.1.RELEASE/spring-messaging-5.2.1.RELEASE.jar!/org/springframework/messaging/converter/AbstractMessageConverter.class
It was loaded from the following location:
file:/E:/User_Data/Maven_Bank/org/springframework/spring-messaging/5.2.1.RELEASE/spring-messaging-5.2.1.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.messaging.converter.AbstractMessageConverter
解决方案
对于上述问题我也是束手无策,上面问题是springcloud中的spring-messaging-5.2.1.RELEASE.jar这个和springboot中的spring-messaging-5.2.1.RELEASE.jar存在版本冲突问题。大概在网上翻阅了1个多小时时间的资料,却无所收获。
这时候小编突然想到了之前在整合丝袜哥的时候出现的bug 大致与上述一致,我就换了一个springboot版本选择使用2.2.2.RELEASE
,然后插香磕头希望能运行。
果不其然 小编的猜猜是正确的,关于SpringBoot 和SpringCloud 版本对应官方的描述:描述地址;由于这个是JSON 格式的,小编已经为大家整理好了。
版本对应
SpringCloud-Version
SpringBoot-Version
Finchley.M2
2.0.0.M3 =< 2.0.0.M5
Finchley.M3
2.0.0.M5 <= 2.0.0.M5
Finchley.M4
2.0.0.M6 <= 2.0.0.M6
Finchley.M5
2.0.0.M7 <= 2.0.0.M7
Finchley.M6
2.0.0.RC1 <= 2.0.0.RC1
Finchley.M7
2.0.0.RC2 <= 2.0.0.RC2
Finchley.M9
2.0.0.RELEASE <= 2.0.0.RELEASE
Finchley.RC1
2.0.1.RELEASE =< 2.0.2.RELEASE
Finchley.RC2
2.0.2.RELEASE =< 2.0.3.RELEASE
Finchley.SR4
2.0.3.RELEASE =< 2.0.999.BUILD-SNAPSHOT
Finchley.BUILD-SNAPSHOT
2.0.999.BUILD-SNAPSHOT =< 2.1.0.M3
Greenwich.M1
2.1.0.M3 =< 2.1.0.RELEASE
Greenwich.SR6
2.1.0.RELEASE =< 2.1.16.BUILD-SNAPSHOT
Greenwich.BUILD-SNAPSHOT
2.1.16.BUILD-SNAPSHOT =< 2.2.0.M4
Hoxton.SR6
2.2.0.M4 =< 2.3.2.BUILD-SNAPSHOT
Hoxton.BUILD-SNAPSHOT
2.3.2.BUILD-SNAPSHOT =< 2.4.0.M1
2020.0.0-SNAPSHOT
2.4.0.M1 <=
目前小编使用的版本是SpringBoot 2.2.2.RELEASE
SpringCloud Hoxton.SR1
;暂时未遇到什么错误
笔者留言
对于这些问题,以后可能会遇到的更多,希望大家不要放弃对未知知识的探索 加油。送大家一句话 别向这个世界认输 因为你还有个牛逼的梦想。