码迷,mamicode.com
首页 > 编程语言 > 详细

spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'

时间:2019-11-04 13:58:19      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:ida   end   least   pat   mvc   beans   display   control   gem   

网关配置好后启动报错如下:

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method ‘servletEndpointRegistrar‘ threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘gatewayControllerEndpoint‘ defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration$GatewayActuatorConfiguration.class]: Unsatisfied dependency expressed through method ‘gatewayControllerEndpoint‘ parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘hystrixGatewayFilterFactory‘ defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration$HystrixConfiguration.class]: Unsatisfied dependency expressed through method ‘hystrixGatewayFilterFactory‘ parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘org.springframework.web.reactive.DispatcherHandler‘ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

只需要把 spring-boot-starter-web 进行排除就 OK 了:

<dependency>
            <groupId>cn.miaoying</groupId>
            <artifactId>common</artifactId>
            <version>${common.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-web</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

 

spring cloud gateway网关启动报错:No qualifying bean of type 'org.springframework.web.reactive.DispatcherHandler'

标签:ida   end   least   pat   mvc   beans   display   control   gem   

原文地址:https://www.cnblogs.com/miaoying/p/11791357.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!