参考:
https://blog.youkuaiyun.com/lh1424573495/article/details/80256635
https://blog.youkuaiyun.com/liujuncheng000/article/details/81092334
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter’: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException
原因:
第一种:看异常java.lang.NoClassDefFoundError:
没有导入依赖:Jackson-databind.导入这个依赖就可以了。
第二种可能:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.1.9.RELEASE</version>
</dependency>
版本问题。 将版本改为4.3.9。(我的异常因为这个)
第三种:(网上 :该异常表示@RequestMapping的注解中出现了重复,不能区分从哪个入口进入)