***************************
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.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
The method's class, org.springframework.boot.actuate.health.CompositeHealthIndicator, is available from the following locations:
jar:file:/D:/local/repo/org/springframework/boot/spring-boot-actuator/2.3.11.RELEASE/spring-boot-actuator-2.3.11.RELEASE.jar!/org/springframework/boot/actuate/health/CompositeHealthIndicator.class
The class hierarchy was loaded from the following locations:
org.springframework.boot.actuate.health.CompositeHealthIndicator: file:/D:/local/repo/org/springframework/boot/spring-boot-actuator/2.3.11.RELEASE/spring-boot-actuator-2.3.11.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.actuate.health.CompositeHealthIndicator
]
Process finished with exit code 1
导入SpringBoot-actuthor包之后项目启动不了
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
关注 让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言
问题描述: 应用启动失败。尝试从以下位置调用不存在的方法:org.springframework.cloud.client.discovery.health.DiscoveryCompositeHealthIndicator.<init>(DiscoveryCompositeHealthIndicator.java:42)。下列方法不存在:org.springframework.boot.actuate.health.CompositeHealthIndicator.<init>(Lorg/springframework/boot/actuate/health/HealthAggregator;)V。该方法的类 org.springframework.boot.actuate.health.CompositeHealthIndicator 可以从以下位置找到:jar:file:D:/local/repo/org/springframework/boot/spring-boot-actuator/2.3.11.RELEASE/spring-boot-actuator-2.3.11.RELEASE.jar!/org/springframework/boot/actuate/health/CompositeHealthIndicator.class。类层次结构从以下位置加载:org.springframework.boot.actuate.health.CompositeHealthIndicator: file:D:/local/repo/org/springframework/boot/spring-boot-actuator/2.3.11.RELEASE/spring-boot-actuator-2.3.11.RELEASE.jar。 问题解决方案: 纠正应用程序的类路径,确保它包含一个单一且兼容的 org.springframework.boot.actuate.health.CompositeHealthIndicator 版本。 例如,在 Maven 中,可以通过使用以下配置来确保只使用一个版本的依赖项:<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.3.11.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
在 Gradle 中,可以使用以下配置来确保只使用一个版本的依赖项:
configurations.all { resolutionStrategy { failOnVersionConflict() force 'org.springframework.boot:spring-boot-starter-web:2.3.11.RELEASE' } }
这将强制 Gradle 使用指定的版本,最终解决依赖项冲突。
解决 无用评论 打赏 举报
悬赏问题
- ¥60 QQOP数据,什么是op数据号,怎么提取op数据!能不能大量提取(语言-c语言)
- ¥15 matlab代码 关于微分方程和嵌套的分段函数。
- ¥15 把VMware项目复制到另一台电脑
- ¥15 onlyoffice编辑完后立即下载,下载的不是最新编辑的文档
- ¥15 求caverdock使用教程
- ¥15 Coze智能助手搭建过程中的问题请教
- ¥15 12864只亮屏 不显示汉字
- ¥20 三极管1000倍放大电路
- ¥15 vscode报错如何解决
- ¥15 前端vue CryptoJS Aes CBC加密后端java解密