项目中途引入Mybatis-plus后报错,报错Caused by: java.lang.ClassNotFoundException: org.mybatis.logging.LoggerFacto

一、报错原因

mybatis-plus和pagehelper jar包冲突,注释mybatis-spring和pagehelper插件即可

<!-- SpringBoot集成mybatis框架 -->
<!--<dependency>-->
    <!--<groupId>org.mybatis.spring.boot</groupId>-->
    <!--<artifactId>mybatis-spring-boot-starter</artifactId>-->
    <!--<version>${mybatis.spring.boot.starter.version}</version>-->
<!--</dependency>-->

<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.2.0</version>
</dependency>

<!-- pagehelper 分页插件 -->
<!--<dependency>-->
    <!--<groupId>com.github.pagehelper</groupId>-->
    <!--<artifactId>pagehelper-spring-boot-starter</artifactId>-->
    <!--<version>${pagehelper.spring.boot.starter.version}</version>-->
<!--</dependency>-->

 

如果还想用这俩插件,升级这俩插件版本

<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>2.1.1</version>
</dependency>

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.2.3</version>
</dependency>
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>5.1.8</version>
</dependency>


<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>mybatis-plus-boot-starter</artifactId>
    <version>3.3.2</version>
</dependency>

 

上一篇:java.lang.IllegalArgumentException: No enum constant Enum(数据库 Integer 转换 Enum 异常)


下一篇:启动 jar 程序,报错:Caused by: java.net.BindException: 地址已在使用