首页 /  技术专区  /  Mybatis 宽屏模式 >

nested exception is java.lang.NoClassDefFoundError: org/mybatis/logging/LoggerFactory

问题背景:

使用 springboot 和 mybatis-plus时候,又导入了mybatis-plus-boot-starterr包。

<!-- Spring Boot pagehelper 依赖 -->
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.2.5</version>
</dependency>


原因分析:

pagehelper-spring-boot-startermybatis-plus-boot-starter发生了版本冲突。


解决方案:

pagehelper-spring-boot-starter 中排除mybatis-plus冲突依赖即可。

<!-- Spring Boot pagehelper 依赖 -->
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.2.5</version>
    <exclusions>
        <exclusion>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
        </exclusion>
    </exclusions>
</dependency>




头像
0/200
图片验证码