Error creating bean with name 'requestMappingHandlerAdapter'

后端 未结 4 1806
囚心锁ツ
囚心锁ツ 2021-01-11 17:19

Am creating a simple REST service using Springframework with Tomcat. The response should have to be in json like {\"id\":\"101\",\"name\":\"Ram\"} .When ever I run, am getti

4条回答
  •  走了就别回头了
    2021-01-11 17:55

    Your cause is

    nested exception is java.lang.ClassCastException: org.springframework.web.accept.ContentNegotiationManagerFactoryBean$$EnhancerByCGLIB$$88a811cb cannot be cast to org.springframework.web.accept.ContentNegotiationManager

    This is probably due to both and @EnableWebMvc are used together. As they are not complementary, either use @EnableWebMvc with Java based config or with xml.

提交回复
热议问题