1. 程式人生 > >SSM使用高版本的spring(我用的5.0.8),報錯Error creating bean with name 'requestMappingHandlerAdapter' defined in

SSM使用高版本的spring(我用的5.0.8),報錯Error creating bean with name 'requestMappingHandlerAdapter' defined in

Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

在修改spring版本為5.0.8之後,導致版本不一致,出現

Error creating bean with name 'requestMappingHandlerAdapter' defined in class path resource

java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException     錯誤

修改jackson的版本,原來的版本太低。

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-core</artifactId>
  <version>2.9.6</version>
  <type>bundle</type>
</dependency>

修改之後問題解決