记一次启动异常排查心路历程
合并代码之后想尝试启动看是否有异常,然后直接报错
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: co/yixiang/modules/userInfo/service/dto/UserAssetManageVo (wrong name: co/yixiang/modules/userinfo/service/dto/UserAssetManageVo)
主体大概意思就是在做实例化的过程中发生了嵌套异常了,并把具体嵌套异常的类地址报出来了
就像尾句是这样的:java.lang.NoClassDefFoundError: co/xxx/xxx/xxx/xxx/xxx/类名
那怎么处理呢,我百度大部分都是告诉你通过maven重新clear,install一下或者清除maven库重新去做下载,然而一顿操作并没有什么用
最后排查了很久,通过应用该类的地方一步步找到mapper层,在xml里面找到了原因
其他开发在修改类路径时,没有修改到mapper的xml,导致其中运行时没有加载到该类报错
我真的是!!!!!!!!淦
最后修改xml文件的类路径成功启动