报错分析nest--嵌套
来源:华佗健康网
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'deptMapper' defined in file [D:\B-project\springboot-mybatis\target\classes\com\example\springmybatis\mapper\deptMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.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 org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\B-project\springboot-mybatis\target\classes\mapper\enumMapper.xml]';
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\B-project\springboot-mybatis\target\classes\mapper\enumMapper.xml]'.
Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.example.springmybatis.domain.enum'.
Cause: java.lang.ClassNotFoundException: Cannot find class: com.example.springmybatis.domain.enum
兄弟,看见没有, 在IDEA里面这是一行,我拆分了一下,看一下每一行的第一个单词,nest。
这个单词什么意思,是嵌套的意思,这个bug意思UnsatisfiedDependencyException包裹了/嵌套了别的异常,别的异常包裹了别的异常。
这样一层层包裹下来,最后一行的cause才是根本原因。
因篇幅问题不能全部显示,请点此查看更多更全内容