springboot集成springCloud中gateway时启动报错的解决
作者:蓝色格子 发布时间:2021-09-05 09:51:34
在项目中引入springcloud中的gateway时报以下错误
Description:
Parameter 0 of method modifyRequestBodyGatewayFilterFactory in org.springframework.cloud.gateway.config.GatewayAutoConfiguration
required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found.Action:
Consider defining a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' in your configuration.
这个是由于依赖冲突,spring-cloud-starter-gateway与spring-boot-starter-web和spring-boot-starter-webflux依赖冲突
解决方式:
在引入gateway时过滤掉上面两个依赖
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</exclusion>
</exclusions>
</dependency>
springboot整合gateway启动失败
问题:
springboot整合gateway启动失败
***************************
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.gatewayHttpClient(GatewayAutoConfiguration.java:622)
The following method did not exist:
reactor.netty.resources.ConnectionProvider.elastic(Ljava/lang/String;Ljava/time/Duration;Ljava/time/Duration;)Lreactor/netty/resources/ConnectionProvider;
The method's class, reactor.netty.resources.ConnectionProvider, is available from the following locations:
jar:file:/C:/Users/Administrator/.m2/repository/io/projectreactor/netty/reactor-netty/0.9.1.RELEASE/reactor-netty-0.9.1.RELEASE.jar!/reactor/netty/resources/ConnectionProvider.class
It was loaded from the following location:
file:/C:/Users/Administrator/.m2/repository/io/projectreactor/netty/reactor-netty/0.9.1.RELEASE/reactor-netty-0.9.1.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.resources.ConnectionProvider
Disconnected from the target VM, address: '127.0.0.1:55875', transport: 'socket'
Process finished with exit code 1
这块主要是版本兼容的问题,
最初用的版本是:
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.9.4.RELEASE</version>
</dependency>
网上有的是需要把这个版本降低,我这是降低了也不行
最后升高了版本改成了:
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.9.14.RELEASE</version>
</dependency>
本项目里springboot版本为:2.3.1,根据自己项目需要吧,看一下自己项目中各个版本之间的问题
来源:https://blog.csdn.net/github_38924695/article/details/99650634


猜你喜欢
- 引子public class InheritableThreadLocalDemo { private stati
- 一. 封装封装是面向对象的三大特性之一;面向对象程序三大特性:封装、继承、多态 。封装:将数据和操作数据的方法进行有机结合,隐藏对象的属性和
- 本文实例为大家分享了Unity实现俄罗斯方块第一部分,供大家参考,具体内容如下准备工作1、新建一个2D项目,新建成功以后设置相机的一些参数2
- 问题(1)synchronized的特性?(2)synchronized的实现原理?(3)synchronized是否可重入?(4)sync
- 下面的题目都是楼主在android交流群大家面试时遇到的,如果大家有好的题目或者好的见解欢迎分享,楼主将长期维护此帖。某公司高级面试题(20
- 背景 最近在工作中遇到一个需求,需要在接收到推送的时候将推送获得的数据存起来,以供app启动时使用。我们会认为这不是So eas
- 本文实例讲述了Android编程中context及全局变量的用法。分享给大家供大家参考,具体如下:今天在研究context的时候,对appl
- Java基础面试题及答案集锦(基础题122道,代码题19道),具体详情如下所示:1、面向对象的特征有哪些方面1.抽象:抽象就是忽略一个主题中
- 判断字符串是否为IP地址通常都是基于正则表达式实现的,无论是引入外部的依赖包亦或是自己写正则实现,基本都是基于正则表达式实现的判断。然而比较
- 在android开发中,经常会遇到一个view需要它能够支持滑动的需求。下面通过本篇文章给大家介绍android view移动的六种方法。l
- java Lock接口java.util.concurrent.locks接口Lockpublic interface Loce
- 1.vs中生成dll对应的生成dll的cpp如下 #include<opencv2/opencv.hpp>#inclu
- 安装完jdk环境后,编写第一个java程序hello.java:public class hello{
- 前言真的一秒就可以实现么?是的,因为我们直接复制粘贴工具类拿来用就可以。 工具类 WaterMarkUtil.java&
- 前言哈喽,我是小黑, 最近学了java的输入输出流后一直心痒痒,总想找一点事情来做,所以用java代码来实现了一下统计代码的所有行数,看一下
- VAR 是3.5新出的一个定义变量的类型其实也就是弱化类型的定义VAR可代替任何类型编译器会根据上下文来判断你到底是想用什么类型的至于什么情
- 针对最近练习项目时出现的乱码问题 -- tomcat编码出现的问题问题出现原因:web.xml中已经加了中文过滤器和json数据转换器,但依
- 1. 源码阅读环境搭建ide:IntelliJ IDEA 2020.1包管理:gradleeureka版本:1.10.11Spring Cl
- 模块之间总是存在这一定的接口,从调用方式上看,可以分为三类:同步调用、回调和异步调用。下面着重详解回调机制。1. 概述Java 中的回调机制
- 字符串操作是C#中最基本的、最常见的、也是用的最多的,以下我总结了几种常见的方法:1.把字符串按照分隔符转换成 List ///