将pom.xml中关于spring-boot-start-web模块的jar依赖去掉。

错误分析:

根据上面描述(Description)中信息了解到GatewayAutoConfiguration这个配置中找不到ServerCodecConfig这个Bean。

spring cloud gateway server项目是一个spring boot项目,在启动的时候会去加载它的配置,其中有一个叫做GatewayClassPathWarningAutoConfiguration的配置类中有这么一行代码:

@Configuration
@ConditionalOnClass(name = "org.springframework.web.servlet.DispatcherServlet")
protected static class SpringMvcFoundOnClasspathConfiguration { public SpringMvcFoundOnClasspathConfiguration() {
log.warn(BORDER+"Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. "+
"Please remove spring-boot-starter-web dependency."+BORDER);
} }

  

在类路径上找到的Spring MVC,此时它与Spring Cloud网关不兼容。请删除spring-boot-start-web依赖项。

因为spring cloud gateway是基于webflux的,如果非要web支持的话需要导入spring-boot-starter-webflux而不是spring-boot-start-web。

gateway启动报错:org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.http.codec.ServerCodecConfigurer' that could not be found的更多相关文章

  1. Spring Cloud Ribbon负载均衡配置类放在Spring boot主类同级增加Exclude过滤后报Field config in com.cloud.web.controller.RibbonConfiguration required a bean of type 'com.netflix.client.config.IClientConfig' that could not b

    环境: Spring Cloud:Finchley.M8 Spring Boot:2.0.0.RELEASE 目录结构: 可以看到代码第13行的注释,我已经在@ComponentScan注解中添加了E ...

  2. Field redisTemplate in xxxxxx required a bean of type 'org.springframework.data.redis.core.RedisTemplate' that could not be found.

    *************************** APPLICATION FAILED TO START *************************** Description: Fie ...

  3. Parameter 0 of method redisTemplate in org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration required a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactor

    Error starting ApplicationContext. To display the conditions report re-run your application with 'de ...

  4. spring cloud gateway 启动报错,Failed to bind on [0.0.0.0:xxx] bind(..) failed: 权限不够

    最近把操作系统迁移到了deepin,不得不说Linux中需要学习的还是有很多的,本地启动网关的时候就遇到一个坑,特此记录一下,报错信息. Caused by: reactor.netty.Channe ...

  5. Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE

    我在springboot项目里面引入了数据库的配置: <dependency> <groupId>org.mybatis.spring.boot</groupId> ...

  6. SpringBoot- springboot集成Redis出现报错:No qualifying bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory'

    Springboot将accessToke写入Redisk 缓存,springboot集成Redis出现报错 No qualifying bean of type 'org.springframewo ...

  7. Spring Cloud ZooKeeper集成Feign的坑1,错误:Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.

    错误如下: ERROR 31473 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** A ...

  8. Consider defining a bean of type 'org.springframework.data.redis.connection.RedisConnectionFactory' in your configuration

    Description: Parameter 0 of method redisTemplate in com.liaojie.cloud.auth.server.config.redis.Redis ...

  9. Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration

    https://www.cnblogs.com/EasonJim/p/7546136.html 错误如下: ERROR 31473 --- [ main] o.s.b.d.LoggingFailure ...

随机推荐

  1. pyecharts各省人口GDP可视化分析

    版权声明:本文为博主原创文章,转载 请注明出处:https://blog.csdn.net/sc2079/article/details/82503569 9月9日更:本篇博客数据下载:链接:http ...

  2. Ubuntu系统---配置OpenCV

    Ubuntu系统---配置OpenCV 目录 一.Ubuntu下配OpenCV 二.Ubuntu下配python-opencv   说明 上述一.二两种方式,配置OpenCV还是有区别的.按个人已有知 ...

  3. Java多维数组定义以及常见异常

    import java.lang.*; import java.util.*; public class Demo1 { public static void main(String args[]){ ...

  4. SimpleThreadPool极简版

    package com.dwz.concurrency.chapter13; import java.util.ArrayList; import java.util.LinkedList; impo ...

  5. Mongo Backup

    #!/bin/sh # This script is run on every mongo node. However, it checks to see if this node is the pr ...

  6. easyUI-filebox图片上传和预览

    转载自:https://blog.csdn.net/nvxiaq/article/details/77740516 备注: 1.如需上传多个图片可定义多个change_photo函数 在onChang ...

  7. C# 读取、写入文件

    读取文件 File.ReadAllText(textBox1.Text,Encoding.ASCII); Form namespace ReadWriteText { public partial c ...

  8. position:absolute 按钮左右分布:left:0 和 right:0 以及雪碧图

    问题:把两个a标签按钮 垂直居中,并且分别把两个按钮放在水平左右两边顶部1,祖父元素设定:position:relative2,把.arrow 设定上下垂直居中 position:absolute; ...

  9. Selenium中使用Cookies绕过登录

    在使用selenium测试后台时常常每个流程都需要走登录流程,这样自然比较浪费时间.如果遇到登录需要输入验证码等情况,就可能出师未捷身先死. 在Web应用中,登录状态通常是通过Cookie中对应的se ...

  10. 一步一步配置AWS ELB Https证书

    第一步:生成CSR 要配置证书,我们首先需要创建一个CSR来向证书提供商申请证书.这个过程我们可以通过IIS中的工具来生成. 然后需要填写如下信息: 下一步后选择文件名后我们就可以创建出CSR 文件了 ...