报错指南
yaoye Lv5


error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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:/C:/MyApplication/Work/repository/maven/repository/com/baomidou/mybatis-plus-core/3.5.7/mybatis-plus-core-3.5.7.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:/C:/MyApplication/Work/repository/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:/C:/MyApplication/Work/repository/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

原因

1
MyBatis 和 MyBatis-Plus 的版本冲突

引入 spring-cloud-gateway 时,提示了 Spring MVC 与 Spring Cloud Gateway 不兼容

原因

Spring Cloud Gateway 是基于 响应式(Reactive) 编程模型,而 Spring MVC 是基于阻塞式的模型。

解决方案

  1. 修改配置文件,设置为响应式 Web 应用程序

    application.yml

    1
    2
    3
    spring:
    main:
    web-application-type: reactive
  2. 移除 spring-boot-starter-web 依赖

    因为其是为 Spring MVC 服务的,如果需要使用 Spring Cloud Gateway 和响应式编程,应使用 spring-boot-starter-webflux 代替。

    移除 spring-boot-starter-web

    1
    2
    3
    4
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    添加 spring-boot-starter-webflux

    1
    2
    3
    4
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-webflux</artifactId>
    </dependency>