确认
当前程序版本
3.5.8
问题描述
在使用SpringBoot3 (3.3.4) 的脚手架当中,选择 SQL / MyBatis Framework 。 当运行时出现异常,疑似版本冲突。
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
<!--mybatis-plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.8</version>
</dependency>
详细堆栈日志
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-09-24T17:09:54.365+08:00 ERROR 15008 --- [my_demo] [ restartedMain] 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.parse(MybatisMapperAnnotationBuilder.java:122)
The following method did not exist:
'void org.apache.ibatis.session.Configuration.parsePendingMethods(boolean)'
The calling method's class, com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder, was loaded from the following location:
jar:file:/D:/Work/DevTools/Maven/repository/com/baomidou/mybatis-plus-core/3.5.8/mybatis-plus-core-3.5.8.jar!/com/baomidou/mybatisplus/core/MybatisMapperAnnotationBuilder.class
The called method's class, org.apache.ibatis.session.Configuration, is available from the following locations:
jar:file:/D:/Work/DevTools/Maven/repository/org/mybatis/mybatis/3.5.14/mybatis-3.5.14.jar!/org/apache/ibatis/session/Configuration.class
The called method's class hierarchy was loaded from the following locations:
org.apache.ibatis.session.Configuration: file:/D:/Work/DevTools/Maven/repository/org/mybatis/mybatis/3.5.14/mybatis-3.5.14.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder and org.apache.ibatis.session.Configuration
Comment From: luozantu
我也一样
Comment From: tAoi386
我也一样
这好像就是纯纯 mybatis 的错误 ,不管plus 什么事。还是老老实实添加maven 依赖把 这脚手架里的依赖有点毛病。这样就不会报错 能共存了。
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.16</version>
</dependency>
<!--mybatis-plus-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
<version>3.5.7</version>
</dependency>