Spring Cloud Finchley.RELEASE 使用 gateway Error creating bean with name 'webHandler' defined in class

匿名 (未验证) 提交于 2019-12-02 22:56:40

pom

<dependency> 			<groupId>org.springframework.cloud</groupId> 			<artifactId>spring-cloud-starter-gateway</artifactId> </dependency> 

只有网关依赖

application.yml

server:   port: 7001 spring:   application:     name: api-geteway   cloud:     gateway:       routes:       -  id: 163          uri: http://www.163.com/          predicates:            - Path=/163/** 

网关转发路径 写死 测试使用

项目启动 异常

2018-11-13 18:12:00.738  WARN 13744 --- [           main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webHandler' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration$EnableWebFluxConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'routePredicateHandlerMapping' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'routePredicateHandlerMapping' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'filteringWebHandler' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'filteringWebHandler' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'websocketRoutingFilter' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]: Unsatisfied dependency expressed through method 'websocketRoutingFilter' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} 2018-11-13 18:12:00.758  INFO 13744 --- [           main] ConditionEvaluationReportLoggingListener :   Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2018-11-13 18:12:00.911 ERROR 13744 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :   *************************** APPLICATION FAILED TO START ***************************  Description:  Parameter 0 of method websocketRoutingFilter in org.springframework.cloud.gateway.config.GatewayAutoConfiguration required a bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' that could not be found.  The following candidates were found but could not be injected: 	- Bean method 'reactorNettyWebSocketClient' in 'GatewayAutoConfiguration.NettyConfiguration' not loaded because @ConditionalOnClass did not find required class 'reactor.ipc.netty.http.client.HttpClient'   Action:  Consider revisiting the entries above or defining a bean of type 'org.springframework.web.reactive.socket.client.WebSocketClient' in your configuration.  Disconnected from the target VM, address: '127.0.0.1:52208', transport: 'socket'  Process finished with exit code 1 

why?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!