spring boot 项目启动报错,先看看启动报错的日志信息:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/web/servlet/config/annotation/DelegatingWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
看了很多的解决方式,这种启动的错误就是加载不了依赖,jar包冲突,网上博客说jdk版本不一致,确实这个问题是可以解决,比如我使用 jdk11就解决了这一个问题,启动正常,不报错,但是当我切换jdk1.8的时候就报错,因为公司的环境是1.8所以我不能使用 jdk11,接下来就我们就来看看大佬能说解决的地方
首先,我们来dug来看看项目是哪里出问题,双击 Shift 进行搜索 : TypeNotPresentExceptionProxy 类
点击进去
选择,进行dug 我们就看到了错误的提示
这里我们看到了错误的提示,是mybatis 的类找不到了
这里就是错误的最终问题,定位到mybatis plus的包冲突了,然后在看pom.xml里面的依赖
发现是这里的依赖出问题了,把下面的删除就可以自行了。