Correct the classpath of your application so that it contains compatible versions of the classes org

原文的错误:

2023-08-08 21:42:38.518 ERROR 4120 --- [           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.boot.SpringApplication.run(SpringApplication.java:306)

The following method did not exist:

    org.springframework.context.ConfigurableApplicationContext.setApplicationStartup(Lorg/springframework/core/metrics/ApplicationStartup;)V

The calling method's class, org.springframework.boot.SpringApplication, was loaded from the following location:

    jar:file:/D:/apache-maven-3.9.3/maven_ropo/org/springframework/boot/spring-boot/2.7.5/spring-boot-2.7.5.jar!/org/springframework/boot/SpringApplication.class

The called method's class, org.springframework.context.ConfigurableApplicationContext, is available from the following locations:

    jar:file:/D:/apache-maven-3.9.3/maven_ropo/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar!/org/springframework/context/ConfigurableApplicationContext.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.context.ConfigurableApplicationContext: file:/D:/apache-maven-3.9.3/maven_ropo/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.SpringApplication and org.springframework.context.ConfigurableApplicationContext

Disconnected from the target VM, address: '127.0.0.1:51002', transport: 'socket'

Process finished with exit code 1

解决办法:只需将pom.xml文件中的:

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<!-- <version>5.1.8.RELEASE</version>-->这一行注释掉(重复引入依赖导致错误)
</dependency>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值