报错Correct the classpath of your application so that it contains a single, compatible version of…

今天在启动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