Spring Cloud Finchley.RELEASE使用gateway Error creating bean with name'webHandler'defined in class
pom
application.yml
プロジェクト起動異常
ソリューション:
私が使っているSpring Bootバージョンは2.1です.0.RELEASE、使用するSpring CloundバージョンはFinchley.RELEASE、理由を見つけてSpring CloundバージョンFinchley.RELEASEはSpring Boot 2.1と互換性がない.0.RELEASE汗、Spring Bootバージョンを2.0に変更.0.RELEASEゲートウェイ使用ok
org.springframework.cloud
spring-cloud-starter-gateway
ゲートウェイ依存Spring Bootバージョンのみ2.1.0.RELEASE、Spring CloundバージョンはFinchley.RELEASEapplication.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?ソリューション:
私が使っているSpring Bootバージョンは2.1です.0.RELEASE、使用するSpring CloundバージョンはFinchley.RELEASE、理由を見つけてSpring CloundバージョンFinchley.RELEASEはSpring Boot 2.1と互換性がない.0.RELEASE汗、Spring Bootバージョンを2.0に変更.0.RELEASEゲートウェイ使用ok