Tim*_*Tim 5 java intellij-idea spring-boot
我有这样一个带有 IntelliJ-Idea IDE 的应用程序,该应用程序的 Springboot 配置会出错并给出以下建议:
The following method did not exist:
org.springframework.context.ConfigurableApplicationContext.setApplicationStartup(Lorg/springframework/core/metrics/ApplicationStartup;)V
The method's class, org.springframework.context.ConfigurableApplicationContext, is available from the following locations:
jar:file:/C:/Users/tlmitch/.m2/repository/org/springframework/spring-context/5.2.8.RELEASE/spring-context-5.2.8.RELEASE.jar!/org/springframework/context/ConfigurableApplicationContext.class
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.context.ConfigurableApplicationContext
Run Code Online (Sandbox Code Playgroud)
我对 IntelliJ-Idea 和 Springboot 比较陌生。如果是 Eclipse,我可能会转到 Java 构建路径并添加包含该类的 jar 文件。
我对 IntelliJ 不太熟悉。到目前为止,如果缺少某些内容,我只是运行“npm install”,这通常会解决它。
有什么建议么?
非常感谢
小智 6
如果您在pom.xml文件中添加了 Spring 依赖项,它们可能会与项目目录中lib文件夹中的 Spring 依赖项发生冲突。删除lib文件夹即可解决此问题。(删除之前只需确保您的项目不依赖于lib文件夹中的其他库)。
正如错误所示:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.context.ConfigurableApplicationContext
Run Code Online (Sandbox Code Playgroud)
您需要确保您的类路径仅包含一个这样的类。您可以使用导航 | 类操作,查看项目中是否存在该类的多个版本,并排除 Mavenpom.xml文件中重复的库依赖项。
| 归档时间: |
|
| 查看次数: |
13058 次 |
| 最近记录: |