springboot启动报错:
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
解决方法:在pom.xml中将这个注释掉。
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
这个jar包是 mybatis开发团队为Spring Boot 提供了 MyBatis的整合的jar包,等于这个包是为了解决springboot整合mybatis用的,帮你做很多自动化的工作,当你配了这个以后,你再引入的mybatis-plus实际上是不会生效的。