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

目录
打赏
0
0
0
0
58
分享
相关文章
Spring Boot 升级 3.2 报错 Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String
Spring Boot 升级 3.2 报错 Invalid value type for attribute ‘factoryBeanObjectType‘: java.lang.String
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
【5月更文挑战第14天】org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
2702 1
|
9月前
|
MongoDB Compass 的教程
这篇文章提供了MongoDB Compass的基本使用教程,包括如何建立数据库连接、创建和删除数据库、插入和修改文档数据,以及执行聚合查询来分析和排序数据。
2311 0
MongoDB Compass 的教程
java报错Error attempting to get column ‘XXX’ from result set. Cause: java.sql.怎么解决?
java报错Error attempting to get column ‘XXX’ from result set. Cause: java.sql.怎么解决?
2748 0
java报错Error attempting to get column ‘XXX’ from result set. Cause: java.sql.怎么解决?
基于Springboot+SpringSecurity+Activiti7实现的工作流系统可方便二次开发(附完整源码)
基于Springboot+SpringSecurity+Activiti7实现的工作流系统可方便二次开发(附完整源码)
404 0
对象存储OSS产品常见问题之图片无法在网页显示如何解决
对象存储OSS是基于互联网的数据存储服务模式,让用户可以安全、可靠地存储大量非结构化数据,如图片、音频、视频、文档等任意类型文件,并通过简单的基于HTTP/HTTPS协议的RESTful API接口进行访问和管理。本帖梳理了用户在实际使用中可能遇到的各种常见问题,涵盖了基础操作、性能优化、安全设置、费用管理、数据备份与恢复、跨区域同步、API接口调用等多个方面。对象存储OSS产品常见问题之
2029 0
无效的目标发行版: 21 和springboot爆错
无效的目标发行版: 21 和springboot爆错
1880 1
mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法
本文讲解:mysql出现ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)的解决方法
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问