搭建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. 系统的学习Devops

    系统的学习devops 1. 学习一门编程语言 Java python JavaScript 2.了解不同的操作系统概念 线程和并发,套接字,I/O管理,虚拟化,内存存储和文件系统 3.掌握终端生存大 ...

  2. 【leetcode】1283. Find the Smallest Divisor Given a Threshold

    题目如下: Given an array of integers nums and an integer threshold, we will choose a positive integer di ...

  3. freemarker页面静态化

    1.工程结构 2. Student public class Student { private int id; private String name; private String address ...

  4. jpa多对一映射

    1.插入 建一个部门类Dept和一个员工类Emp: Emp对Dept是多对一的关系:因为一个部门有多个员工,而一个员工只有一个部门:   Emp类中添加一个Dept的属性: @ManyToOne注解表 ...

  5. ASCII和UTF-8

    造冰箱的熊猫@cnblogs 2018/12/11 用了这么久的UTF-8,第一次了解了点UTF-8的细节 UTF-8[1]属于变长度编码.一个UTF-8字符的编码长度为1~4个字节. 1)长度为1个 ...

  6. Ubuntu中安装MySQL

    基本步骤: 1. sudo apt-get install mysql-server 2. apt-get install mysql-client 3.  sudo apt-get install ...

  7. 【CUDA 基础】3.4 避免分支分化

    - title: [CUDA 基础]3.4 避免分支分化 categories: - CUDA - Freshman tags: - 规约问题 - 分支分化 toc: true date: 2018- ...

  8. [题解] [TJOI2011] 构造矩阵

    题面 题解 很容易看出来是道网络流的题目, 要是没有这个字典序最小, 直接建图跑一遍就好了, 考虑如何输出字典序最小的方案 我们可以贪心地去选择, 若当前点可以选0就选0, 不能选0就选1, 有一点像 ...

  9. C++ this指针的理解

    先要理解class的意思.class应该理解为一种类型,象 int,char一样,是用户自定义的类型.虽然比int char这样build-in类型复杂的多,但首先要理解它们一样是类型.用这个类型可以 ...

  10. 修改PostgreSQL数据库的默认用户postgres的密码 并新建用户

    1.忘记了postgresql 安装时默认用户postgres 的密码,怎么办呢? linux shell命令下面输入: sudo -u postgres psql  (这样就可以直接登录进postg ...