• spring-cloud-gateway启动失败以及springboo和springcloud版本对应关系总结


    gateway启动失败和版本对应

    问题描述

    springcloud和springboot一般都是需要版本号匹配的,如果这一块不注意的话,很多时候在导入某些pom依赖时,会出现错误。我这里碰到的是spring-cloud-start-gateway的问题

    gateway 启动错误信息

    Description:
    
    An attempt was made to call a method that does not exist. The attempt was made from the following location:
    
        org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration.buildConnectionProvider(GatewayAutoConfiguration.java:798)
    
    The following method did not exist:
    
        reactor.netty.resources.ConnectionProvider$Builder.evictInBackground(Ljava/time/Duration;)Lreactor/netty/resources/ConnectionProvider$ConnectionPoolSpec;
    
    The method's class, reactor.netty.resources.ConnectionProvider$Builder, is available from the following locations:
    
        jar:file:/D:/maven/repository/io/projectreactor/netty/reactor-netty/0.9.12.RELEASE/reactor-netty-0.9.12.RELEASE.jar!/reactor/netty/resources/ConnectionProvider$Builder.class
    
    The class hierarchy was loaded from the following locations:
    
        reactor.netty.resources.ConnectionProvider.Builder: file:/D:/maven/repository/io/projectreactor/netty/reactor-netty/0.9.12.RELEASE/reactor-netty-0.9.12.RELEASE.jar
        reactor.netty.resources.ConnectionProvider.ConnectionPoolSpec: file:/D:/maven/repository/io/projectreactor/netty/reactor-netty/0.9.12.RELEASE/reactor-netty-0.9.12.RELEASE.jar
    
    
    Action:
    
    Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.resources.ConnectionProvider$Builder
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    常见解决办法

    我网上看了一下,大多数是说修改netty的版本号。

    版本号对应问题解决方法

    方法一

    这个方法比较宽,只能看个大概,而且也比较常见。但是有可能会还是有问题
    官方提供的版本号匹配
    在这里插入图片描述
    这里存在一个问题,范围太宽了。例如spring-cloud Hoxton.SR12版本对应 spring boot 2.2.0到2.4.0。但是我在实际使用中出错了。我这里使用的是 spring-cloud Hoxton SR12spring-boot 2.3.4

    精确版本

    • 打开 spring-cloud 官网 链接
    • 选择后面的 Reference.Doc
      在这里插入图片描述
    • 打开的页面中就有对应的版本号关系
      在这里插入图片描述
    • 如果想要的版本号没有,可以通过手动改url中的信息
      在这里插入图片描述
      这里我改成 Hoxton.SR10
      在这里插入图片描述
      我这里通过修改springboot 的版本号 spring-cloud Hoxton.SR12spring-boot 2.3.12.Release 后,gateway项目能正常启动了。而不是常见答案中的修改 netty版本号

    参考文章

    参考

  • 相关阅读:
    Unity脚本API—Transform 变换
    菜鸡的秋招升级打怪之旅
    codeforces 1239D-Catowice City(tarjan缩点)
    Nginx--Rewrite重写
    数据管理70个名词解析
    STM32存储左右互搏 I2C总线读写FRAM MB85RC1M
    深度学习库 SynapseML for .NET 发布0.1 版本
    植物大战僵尸机枪射手怎么发出多枚子弹
    力扣(518.377)补7.31
    TypeScript入门
  • 原文地址:https://blog.csdn.net/m0_67403272/article/details/126505869