搭建springcloud项目的时候以 zookeeper为注册中心  gateway为路由 启动时出现以下报错:

**********************************************************

Spring MVC found on classpath, which is incompatible with Spring Cloud Gateway at this time. Please remove spring-boot-starter-web dependency.

**********************************************************

2019-05-05 09:41:19.216 WARN [-,,,] 10084 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'routeDefinitionRouteLocator' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'routeDefinitionRouteLocator' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'modifyRequestBodyGatewayFilterFactory' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'modifyRequestBodyGatewayFilterFactory' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.http.codec.ServerCodecConfigurer' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2019-05-05 09:41:19.219 INFO [-,,,] 10084 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2019-05-05 09:41:19.234 INFO [-,,,] 10084 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-05-05 09:41:19.401 ERROR [-,,,] 10084 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

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.

原因:

  在类路径上找到了SpringMVC,此时它与SpringCloudGateway不兼容。请删除Spring Boot Starter Web依赖项。

  然后看pom.xml里面并没有依赖SpringMVC相关依赖,然而是zookeeper里面依赖了web,SpringCloudGateway依赖于webflux 所以不兼容

  

springcloud zookeeper+gateway的更多相关文章

  1. 【SpringCloud】Gateway 配置全局过滤器获取请求参数和响应值

    [SpringCloud]Gateway 配置全局过滤器获取请求参数和响应值 实现Ordered接口getOrder()方法,数值越小越靠前执行,记得这一点就OK了. 获取请求参数RequestBod ...

  2. SpringCloud之Gateway

    一.为什么选择SpringCloud Gateway而不是Zuul? Gateway和Zuul的职责一样,都承担着请求分发,类似Nginx分发到后端服务器. 1.SpingCloud Gateway ...

  3. 微服务SpringCloud之GateWay路由

    在前面博客学习了网关zuul,今天学下spring官方自带的网关spring cloud gateway.Zuul(1.x) 基于 Servlet,使用阻塞 API,它不支持任何长连接,如 WebSo ...

  4. springcloud中gateway的实际应用

    之前我一直用的是Zuul网关,用过gateway以后感觉比Zuul功能还是强大很多. Spring Cloud Gateway是基于Spring5.0,Spring Boot2.0和Project R ...

  5. SpringCloud实战 | 第四篇:SpringCloud整合Gateway实现API网关

    一. 前言 微服务实战系列是基于开源微服务项目 有来商城youlai-mall 版本升级为背景来开展的,本篇则是讲述API网关使用Gateway替代Zuul,有兴趣的朋友可以进去给个star,非常感谢 ...

  6. springcloud组件gateway断言(Predicate)

    Spring Cloud Gateway是SpringCloud的全新子项目,该项目基于Spring5.x.SpringBoot2.x技术版本进行编写,意在提供简单方便.可扩展的统一API路由管理方式 ...

  7. SpringCloud创建Gateway模块

    1.说明 本文详细介绍Spring Cloud创建Gateway模块的方法, 基于已经创建好的Spring Cloud父工程, 请参考SpringCloud创建项目父工程, 和已经创建好的Eureka ...

  8. 深入理解SpringCloud之Gateway

    虽然在服务网关有了zuul(在这里是zuul1),其本身还是基于servlet实现的,换言之还是同步阻塞方式的实现.就其本身来讲它的最根本弊端也是再此.而非阻塞带来的好处不言而喻,高效利用线程资源进而 ...

  9. 微服务SpringCloud之GateWay服务化和过滤器

    Spring Cloud Gateway 提供了一种默认转发的能力,只要将 Spring Cloud Gateway 注册到服务中心,Spring Cloud Gateway 默认就会代理服务中心的所 ...

随机推荐

  1. 基于LVM 测试磁盘写性能.md

    准备工作 /dev/sdb 创建一个卷组,基于卷组创建5个逻辑卷,各100G 在10.10.88.214 新建5台虚拟机,每台虚拟机用到lvm建的逻辑卷 dd 压测 在每台虚拟机上执行dd 命令: d ...

  2. java——ThreadLocal、ThreadLocalMap、Thread三者的关系

    https://www.jianshu.com/p/377bb840802f Thread类中维护了一个成员变量:ThreadLocalMap 每个Thread有一个自己的ThreadLocalMap ...

  3. 【Wince-ListView】Wince中的 ListView怎么显示网格?

    using System.Runtime.InteropServices; using System.Windows.Forms; namespace CETEST { public class Co ...

  4. IDEA运行有问题debug正常解决方案

    朋友们!有没有遇到这样的问题,IDEA运行有问题,debug确是正常的,不经怀疑人生! 不要慌!点击maven,clean一下,再compile一下,就好啦! 不要慌!点击maven,clean一下, ...

  5. idea 2017 破解方法

    一.先进入Intellij IDEA的官网:https://www.jetbrains.com,下载安装 二.破解. 网上的破解方法较多,总结下来大概有下面几种办法供大家作为参考 声明:破解用于学习和 ...

  6. UNIX下socket通信 - UDP通信

    一.UNIX下socket通信: socket套接字是一种可以进行网络通信的内核对象,它是一个唯一的标示符,一般称它为socket描述符. 注意:UDP通信需要客户端先发送消息,服务端先进行等待客户端 ...

  7. noi.ac#458 sequence

    题目链接:戳我 蒟蒻的第一道子序列自动机! 给定两个01串A,B,求一个最短的01串,要求C不是A,B的子序列.要求如果同样短,输出字典序最小的. 那么我们先构建A,B两个串的子序列自动机.然后我们设 ...

  8. IDEA怎么开启终端Terminal

    方法一:在IDEA中点击view→tool window→Terminal即可开启 方法二:按住ALT+F12(如果是笔记本按不出来的话再加个Fn键)

  9. koa 基础(十四)cookie 的基本使用

    1.app.js /** * cookie的简介: * 1.cookie保存在浏览器客户端 * 2.可以让我们用同一个浏览器访问同一个域名的时候共享数据 * * cookie的作用: * 1.保存用户 ...

  10. LeetCode 分类颜色

    LeetCode   分类颜色 给定一个包含红色.白色和蓝色,一共 n 个元素的数组,原地对它们进行排序,使得相同颜色的元素相邻,并按照红色.白色.蓝色顺序排列. 此题中,我们使用整数 0. 1 和 ...