记录一次异常

原创
2023/11/04 00:24
阅读数 20

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-11-04 00:21:54.353 ERROR 4614 --- [           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.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration.resourceHandlerMapping(WebMvcAutoConfiguration.java:408)

The following method did not exist:

    'org.springframework.web.servlet.HandlerMapping org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration.resourceHandlerMapping(org.springframework.web.util.UrlPathHelper, org.springframework.util.PathMatcher, org.springframework.web.accept.ContentNegotiationManager, org.springframework.format.support.FormattingConversionService, org.springframework.web.servlet.resource.ResourceUrlProvider)'

The method's class, org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration, is available from the following locations:

    jar:file:/Users/johnnote15/.m2/repository/org/springframework/spring-webmvc/5.3.22/spring-webmvc-5.3.22.jar!/org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class

The class hierarchy was loaded from the following locations:

    org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: file:/Users/johnnote15/.m2/repository/org/springframework/spring-webmvc/5.3.22/spring-webmvc-5.3.22.jar
    org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport: file:/Users/johnnote15/.m2/repository/org/springframework/spring-webmvc/5.3.22/spring-webmvc-5.3.22.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration

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

Process finished with exit code 1

原因:

IDEA 缓存的依赖与MAVEN不一致导致

解决方法:

删除IDEA项目配置(project structure)中的所有依赖,然后在maven中刷新让其重新生成依赖

 

展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部