spring boot 集成 flowable + mybatisplus冲突解决
flowable + mybatisplus冲突解决
开发项目使用技术栈spring boot 2 + mybatis-plus + flowable 6.3时, 启动报错,如下:
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:384)
The following method did not exist:
org.apache.ibatis.session.Configuration.getLanguageDriver(Ljava/lang/Class;)Lorg/apache/ibatis/scripting/LanguageDriver;
The calling method's class, com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder, was loaded from the following location:
jar:file:/D:/maven/repository/com/baomidou/mybatis-plus-core/3.4.3.4/mybatis-plus-core-3.4.3.4.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:/maven/repository/org/mybatis/mybatis/3.4.5/mybatis-3.4.5.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:/maven/repository/org/mybatis/mybatis/3.4.5/mybatis-3.4.5.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
仔细查看问题描述,一直没搞懂mybatis 怎么引入的,后来才发现flowable是也会引入 mybatis,导致jar冲突。
找到问题所在,解决起来就简单了:
在pom.xml 中,引入 flowable 时,排除 mybatis 的部分即可。
<dependency> <groupId>org.flowable</groupId> <artifactId>flowable-spring-boot-starter</artifactId> <version>6.3.0</version> <exclusions> <exclusion> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> </exclusion> </exclusions> </dependency>
文章借鉴:spring boot 集成 flowable 时mybatis-plus-core-3.1.2.jar 冲突 - 赵晓欣的个人空间 - OSCHINA - 中文开源技术交流社区
更多推荐
所有评论(0)