今天在啓動Spring boot 時遇到報錯,詳細以下java
Description:spring
An attempt was made to call a method that does not exist. The attempt was made from the following location:app
org.springframework.cloud.client.discovery.health.DiscoveryCompositeHealthIndicator.<init>(DiscoveryCompositeHealthIndicator.java:42)spring-boot
The following method did not exist:spa
org.springframework.boot.actuate.health.CompositeHealthIndicator.<init>(Lorg/springframework/boot/actuate/health/HealthAggregator;)Vip
The method's class, org.springframework.boot.actuate.health.CompositeHealthIndicator, is available from the following locations:it
jar:file:/C:/Users/Administrator/.m2/repository/org/springframework/boot/spring-boot-actuator/2.2.1.RELEASE/spring-boot-actuator-2.2.1.RELEASE.jar!/org/springframework/boot/actuate/health/CompositeHealthIndicator.classio
It was loaded from the following location:class
file:/C:/Users/Administrator/.m2/repository/org/springframework/boot/spring-boot-actuator/2.2.1.RELEASE/spring-boot-actuator-2.2.1.RELEASE.jarcli
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.actuate.health.CompositeHealthIndicator
緣由:
jar包重複
解決方法:
刪掉 spring-boot-starter-actuator