SpringCloud启动报错,提示The Following Method Did Not exist:CompositeHealthIndicator

今天升级SpringBoot的版本,然后启动的时候懵逼了,报了个错:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
 Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web

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:


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

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

org.springframework.cloud.client.discovery.health.DiscoveryCompositeHealthIndicator.<init>(DiscoveryCompositeHealthIndicator.java:42)

The following method did not exist:

org.springframework.boot.actuate.health.CompositeHealthIndicator.<init>(Lorg/springframework/boot/actuate/health/HealthAggregator;)V**

翻了一下资料后,发现是SpringBoot和SpringCloud的版本不匹配,修改成一致的就行了

Release Train Boot Version
Hoxton 2.2.x
Greenwich 2.1.x
Finchley 2.0.x
Edgware 1.5.x
Dalston 1.5.x