启动Spring Cloud Gateway时报错,出现 “An attempt was made to call a method that does not exist. ……”

导读:本篇文章讲解 启动Spring Cloud Gateway时报错,出现 “An attempt was made to call a method that does not exist. ……”,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com

1、错误信息:The following method did not exist: reactor.netty.resources.ConnectionProvider

B

u

i

l

d

e

r

.

e

v

i

c

t

I

n

B

a

c

k

g

r

o

u

n

d

(

L

j

a

v

a

/

t

i

m

e

/

D

u

r

a

t

i

o

n

;

)

L

r

e

a

c

t

o

r

/

n

e

t

t

y

/

r

e

s

o

u

r

c

e

s

/

C

o

n

n

e

c

t

i

o

n

P

r

o

v

i

d

e

r

Builder.evictInBackground(Ljava/time/Duration;)Lreactor/netty/resources/ConnectionProvider

Builder.evictInBackground(Ljava/time/Duration;)Lreactor/netty/resources/ConnectionProviderConnectionPoolSpec;

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2021-11-17 13:50:00.745 ERROR 4936 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : ***************************APPLICATION FAILED TO START***************************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:/E:/mvn_repo/io/projectreactor/netty/reactor-netty/0.9.11.RELEASE/reactor-netty-0.9.11.RELEASE.jar!/reactor/netty/resources/ConnectionProvider$Builder.classThe class hierarchy was loaded from the following locations:    reactor.netty.resources.ConnectionProvider.Builder: file:/E:/mvn_repo/io/projectreactor/netty/reactor-netty/0.9.11.RELEASE/reactor-netty-0.9.11.RELEASE.jar    reactor.netty.resources.ConnectionProvider.ConnectionPoolSpec: file:/E:/mvn_repo/io/projectreactor/netty/reactor-netty/0.9.11.RELEASE/reactor-netty-0.9.11.RELEASE.jarAction:Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.resources.ConnectionProvider$BuilderDisconnected from the target VM, address: '127.0.0.1:51122', transport: 'socket'Process finished with exit code 1

  当运行Spring Cloud Gateway时,出现了如下错误,为什么出现这样的错误呢?在之前,已经按照这种方式成功启动过Spring Cloud Gateway程序了,为什么这次又不行了呢?

  问题原因: 出现该问题的原因,是因为我在搭建Spring Cloud Gateway环境的时候,使用的SpringBoot、SpringCloud 和 SpringCloud Alibaba 组件的时候,版本不一致造成的,通过修改其中引用的组件版本,可以修改该问题。版本兼容如下所示:
在这里插入图片描述

详细请查看《阿里巴巴 官方 版本说明》

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/68724.html

(0)
小半的头像小半

相关推荐

极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!