• springcloud zookeeper+gateway


    搭建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 所以不兼容

            

      

  • 相关阅读:
    docker学习之network:初识网络配置
    原来:HTTP可以复用TCP连接
    git tag的用法及意义
    Android,社招,面淘宝,指南【内部人员为你保驾护航】
    别了,拼多多!再也不想砍一刀了,哔哩哔哩 (゜-゜)つロ 干杯~
    【Android面试宝典】2021年,腾讯等大厂Android高级开发面试完全攻略!
    腾讯40岁老兵现身说法:35岁职业生涯分水岭,架构or管理,到底怎么选?
    【整理合集】Flutter 常用第三方库、插件、学习资料等
    [PAT]1011 World Cup Betting (20 分)Java
    [PAT] 1010 Radix (25 分)Java
  • 原文地址:https://www.cnblogs.com/tangyin/p/10813261.html
Copyright © 2020-2023  润新知