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依赖即可解决问题。

相关文章
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
“Could not find suitable distribution for Requirement.parse(‘XXXX‘)”的问题
390 0
|
3月前
|
Java
flyway报错Correct the classpath of your application so that it contains compatible versions of the
flyway报错Correct the classpath of your application so that it contains compatible versions of the
96 1
|
7月前
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `Pods/Target S
107 0
|
7月前
|
C语言 计算机视觉
opencv 编译objects.a(vs_version.rc.obj)‘ is incompatible with i386:x86-64 output
opencv 编译objects.a(vs_version.rc.obj)‘ is incompatible with i386:x86-64 output
60 0
使用pageHelper报错 Type definition error: [simple type, classXXXX]
使用pageHelper报错 Type definition error: [simple type, classXXXX]
|
Kotlin
Program type already present: org.intellij.lang.annotations.Flow\Program type already present: org.i
Program type already present: org.intellij.lang.annotations.Flow\Program type already present: org.i
129 0
Program type already present: org.intellij.lang.annotations.Flow\Program type already present: org.i
|
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
143 0
|
算法
On the Correct and Complete Enumeration of the Core Search Space
在之前的文章中我们讨论了基于graph的DP-based算法,来解决join ordering的枚举问题。 这些DP算法通过join predicate描述的连通性,解决了枚举可能的表组合问题,但join graph本身(即使hypergraph)是无法完整的描述join语义的,因为连通边本身无法描述不同类型的join语义,例如left outer join/semi join/anti join...,因此即使找到了所谓的csg-cmp-pair,也不一定是有效的plan。 这篇paper讨论的就是这个问题,当枚举出一个csg-cmp-pair (S1 o S2),如何判断这是有效的join
465 0
On the Correct and Complete Enumeration of the Core Search Space