IDEA启动项目时报错Correct the classpath of your application so that it contains a single, compatible version of com.baomidou.mybatisplus.core.MybatisConfiguration

报错内容如下:
2020-07-29 21:31:16.891 ERROR 12488 — [main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.getLanguageDriver(MybatisMapperAnnotationBuilder.java:371)
The following method did not exist: com.baomidou.mybatisplus.core.MybatisConfiguration.getLanguageDriver(Ljava/lang/Class;)Lorg/apache/ibatis/scripting/LanguageDriver;
The method’s class, com.baomidou.mybatisplus.core.MybatisConfiguration, is available from the following locations:
jar:file:/D:/MavenRepository/maven_jar/com/baomidou/mybatis-plus-core/3.3.2/mybatis-plus-core-3.3.2.jar!/com/baomidou/mybatisplus/core/MybatisConfiguration.class
The class hierarchy was loaded from the following locations:
com.baomidou.mybatisplus.core.MybatisConfiguration: file:/D:/MavenRepository/maven_jar/com/baomidou/mybatis-plus-core/3.3.2/mybatis-plus-core-3.3.2.jar**
org.apache.ibatis.session.Configuration: file:/D:/MavenRepository/maven_jar/org/mybatis/mybatis/3.4.6/mybatis-3.4.6.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of com.baomidou.mybatisplus.core.MybatisConfiguration
Process finished with exit code 1
报错截图如下:
在这里插入图片描述
意思就是pom.xml里面的依赖包有重复,需要将重复的依赖包删除
我这里是mybatis-plus-core-3.3.2.jarmybatis-3.4.6.jar重复了,
那么我们来到pom.xml中
用快捷键ctrl+f打开搜索栏,输入mybatis,如图所示

把其中一个依赖包的删除就行,我这里把mybatis-plus-boot-starter依赖包删除

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

输入完毕后,更新依赖
在这里插入图片描述
重新启动项目

希望能解决同样的问题,欢迎讨论。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐