當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
Spring Boot项目无法找到getMediaTypeMappings()方法
生活随笔
收集整理的這篇文章主要介紹了
Spring Boot项目无法找到getMediaTypeMappings()方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
記錄一次踩坑的解決。報錯 如下
Description:An attempt was made to call a method that does not exist. The attempt was made from the following location:org.springframework.web.servlet.resource.ResourceHttpRequestHandler.afterPropertiesSet(ResourceHttpRequestHandler.java:378)The following method did not exist:org.springframework.web.accept.ContentNegotiationManager.getMediaTypeMappings()Ljava/util/Map;The method's class, org.springframework.web.accept.ContentNegotiationManager, is available from the following locations:jar:file:/C:/Users/Shinelon/.m2/repository/org/springframework/spring-web/5.2.2.RELEASE/spring-web-5.2.2.RELEASE.jar!/org/springframework/web/accept/ContentNegotiationManager.classIt was loaded from the following location:file:/C:/Users/Shinelon/.m2/repository/org/springframework/spring-web/5.2.2.RELEASE/spring-web-5.2.2.RELEASE.jarAction:Correct the classpath of your application so that it contains a single, compatible version of org.springframework.web.accept.ContentNegotiati添加spring-web
<dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>5.2.4.RELEASE</version> </dependency>注意如果存在spring-webmvc,那么保持版本號一致
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的Spring Boot项目无法找到getMediaTypeMappings()方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 简单介绍基于Spring Boot的项目
- 下一篇: android异步线程利用Handler