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

Spring boot project startup error:

As mentioned in 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.

There are old projects and configurations (xml configuration) that depend on the Spring boot project, @EnableWebMvc just kill it

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326178679&siteId=291194637