SpringBoot3.4.0和OpenFeign4.1.4不兼容

发布于:2024-12-06 ⋅ 阅读:(130) ⋅ 点赞:(0)

SpringBoot3.4.0和OpenFeign4.1.4不兼容

SpringBoot升级到3.4.0版本,和OpenFeign不兼容,maven install 时报错,即使OpenFeign升到最新版本4.1.4,依然不兼容。

SpringBoot版本降为3.3.6 ,maven install 成功。

创建日期:2024年11月28日 星期四

Maven install 报错信息

2024-11-28T19:28:25.679+08:00  WARN 12536 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compositeCompatibilityVerifier' defined in class path resource [org/springframework/cloud/configuration/CompatibilityVerifierAutoConfiguration.class]: Failed to instantiate [org.springframework.cloud.configuration.CompositeCompatibilityVerifier]: Factory method 'compositeCompatibilityVerifier' threw exception with message: Spring Cloud/ Spring Boot version compatibility checks have failed: [[VerificationResult@d6b532f description = 'Spring Boot [3.4.0] is not compatible with this Spring Cloud release train', action = 'Change Spring Boot version to one of the following versions [3.2.x, 3.3.x] .
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn]. 
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
If you want to disable this check, just set the property [spring.cloud.compatibility-verifier.enabled=false]']]
============================
CONDITIONS EVALUATION REPORT
============================

报错分析(AI问答)

这个错误信息表明在尝试初始化Spring Boot应用时,Spring Cloud的兼容性检查失败了。具体来说,你当前使用的Spring Boot版本(3.4.0)与你的Spring Cloud版本不兼容。

错误详情:

  • 错误描述Spring Boot [3.4.0] is not compatible with this Spring Cloud release train
  • 建议操作:更改Spring Boot的版本到以下之一:3.2.x, 3.3.x
  • 可选方案:如果不想更改Spring Boot版本,可以禁用兼容性检查,通过设置属性spring.cloud.compatibility-verifier.enabled=false

解决方法:

  1. 更改Spring Boot版本:你可以根据提示将Spring Boot的版本更改为3.2.x或3.3.x中的一个,以确保与当前使用的Spring Cloud版本兼容。
  2. 禁用兼容性检查:如果你希望继续使用当前的Spring Boot版本,并且愿意承担可能因此带来的兼容性问题,可以在配置文件中添加以下配置来禁用兼容性检查:
    spring:
      cloud:
        compatibility-verifier:
          enabled: false
    
  3. 更新Spring Cloud版本:另一个解决方案是查找并使用与Spring Boot 3.4.0兼容的Spring Cloud版本。通常,每个Spring Boot主要版本都有对应的Spring Cloud版本。你可以访问Spring Cloud项目页面查看版本兼容性表,找到合适的Spring Cloud版本进行更新。

选择上述任一方法解决兼容性问题后,重新构建和运行你的应用程序,应该可以解决这个问题。

不兼容版本

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.4.0</version>
    </parent>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-openfeign</artifactId>
    <version>4.1.4</version>
</dependency>



网站公告

今日签到

点亮在社区的每一天
去签到