Correct the classpath of your application so that it contains compatible versions of the classes com

简介: Correct the classpath of your application so that it contains compatible versions of the classes com


在使用springboot集成camunda卡蒙达工作流引擎时报错,报错信息如下:

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:385)

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:/G:/repository/com/baomidou/mybatis-plus-core/3.5.1/mybatis-plus-core-3.5.1.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:/G:/repository/org/mybatis/mybatis/3.4.4/mybatis-3.4.4.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:/G:/repository/org/mybatis/mybatis/3.4.4/mybatis-3.4.4.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的依赖了,而camunda里面也带了mybatis,所以只需要在引入camunda的时候排除掉mybatis即可。

原来代码:

<dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter</artifactId>
      <version>3.4.0</version>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
      <version>3.4.0</version>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
      <version>3.4.0</version>
    </dependency>

解决后的代码:

<dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.mybatis</groupId>
          <artifactId>mybatis</artifactId>
        </exclusion>
      </exclusions>
      <version>3.4.0</version>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.mybatis</groupId>
          <artifactId>mybatis</artifactId>
        </exclusion>
      </exclusions>
      <version>3.4.0</version>
    </dependency>
    <dependency>
      <groupId>org.camunda.bpm.springboot</groupId>
      <artifactId>camunda-bpm-spring-boot-starter-webapp</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.mybatis</groupId>
          <artifactId>mybatis</artifactId>
        </exclusion>
      </exclusions>
      <version>3.4.0</version>
    </dependency>

刷新maven依赖即可解决问题。

目录
相关文章
Ninja is required to load C++ extensions | 问题解决
Ninja is required to load C++ extensions | 问题解决
|
12月前
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
211 0
|
5月前
|
设计模式 人工智能 Java
Error: JavaFX runtime components are missing, and are required to run this application with Gradle e
Error: JavaFX runtime components are missing, and are required to run this application with Gradle e
73 1
|
9月前
|
Java Apache Spring
解决required a single bean, but 2 were found问题
背景:springboot整合shiro中自定义Realm时出现 错误描述 Parameter 0 of method getDefaultWebSecurityManager in cn.ken.springboot_shiro.config.ShiroConfig required a single bean, but 2 were foun
|
Java
The type XXX cannot be resolved. It is indirectly referenced from required .class files
The type XXX cannot be resolved. It is indirectly referenced from required .class files
84 0
成功解决The following specifications were found to be incompatible with the existing python installation
成功解决The following specifications were found to be incompatible with the existing python installation
|
人工智能 Java vr&ar
de.hybris.platform.impex.jalo.ImpExException: incompatible item reference values
de.hybris.platform.impex.jalo.ImpExException: incompatible item reference values
256 0
|
Java
Hybris DDIC type and its counterpart model class
Hybris DDIC type and its counterpart model class
110 0
Hybris DDIC type and its counterpart model class
How is target My note application rendered - renderManager
Created by Wang, Jerry, last modified on May 18, 2015
101 0
How is target My note application rendered - renderManager
why in GM0 our extension component this.sPath is not correct
Created by Wang, Jerry, last modified on May 20, 2015
89 0
why in GM0 our extension component this.sPath is not correct