cannot be cast to org.springframework.web.accept.ContentNegotiationManager

Spring boot项目启动报错:

https://stackoverflow.com/questions/19199610/spring-issue-with-contentnegotiationmanagerfactorybean中提到:

As Pavel Horal commented, don't use both <mvc:annotation-driven /> and @EnableWebMvc together. That drives Spring mad when it tries to processe already enhanced classes where not-enhanced are expected, thus ClassCast. Simply use either of them.

Spring boot项目里面有依赖旧的项目以及配置(xml配置),干掉@EnableWebMvc 就好了

猜你喜欢

转载自my.oschina.net/airship/blog/1809532