新项目需要使用mybatis-plus,所以按照官方快速开始的指引开始构建项目,没想到一开始就报错了……
排查了我一下午……各种加和删mapperscan,mapper,Repository等等排列组合都尝试了,没一个从根本上解决问题,整个项目加起来总共就不出5个文件,最后突然想到只剩pom文件的依赖没看了,因为是从老项目直接找了个pom包来,抱着尝试一下的目的删掉了mybatis的依赖,结果真的跑起来了……
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: org/mybatis/logging/LoggerFactory