简体   繁体   English

Spring Cloud Gateway 2.0.0.RELEASE:无法找到名称为 Hystrix 的 GatewayFilterFactory

[英]Spring Cloud Gateway 2.0.0.RELEASE:Unable to find GatewayFilterFactory with name Hystrix

application.properties:应用程序属性:

spring.cloud.gateway.discovery.locator.enabled=true
logging.level.org.springframework.cloud.gateway=debug
spring.cloud.gateway.routes[0].uri=lb://BIZSERVICE-DEMO
spring.cloud.gateway.routes[0].predicates[0]=Path=/demo/**
spring.cloud.gateway.routes[0].filters[0].name=StripPrefix
spring.cloud.gateway.routes[0].filters[0].args.parts=1
spring.cloud.gateway.routes[0].filters[1].name=Hystrix
spring.cloud.gateway.routes[0].filters[1].args.name=fallbackcmd
spring.cloud.gateway.routes[0].filters[1].args.fallbackUri=forward:/fallback
hystrix.command.fallbackcmd.execution.isolation.thread.timeoutInMilliseconds=5000

When I run gateway service,visit http://.../demo/123,the console reports:当我运行网关服务时,访问http://.../demo/123,控制台报告:

2018-08-02 14:50:49.454 [reactor-http-nio-2] ERROR ipf.filter.ExceptionHandler - {timestamp=Thu Aug 02 14:50:49 CST 2018, path=/demo/demo/1, status=500, error=Internal Server Error, message=Unable to find GatewayFilterFactory with name Hystrix, trace=java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name Hystrix at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.lambda$loadGatewayFilters$3(RouteDefinitionRouteLocator.java:142) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at 2018-08-02 14:50:49.454 [reactor-http-nio-2] 错误 ipf.filter.ExceptionHandler - {timestamp=Thu Aug 02 14:50:49 CST 2018,path=/demo/demo/1,状态=500,错误=内部服务器错误,消息=无法找到名称为 Hystrix 的 GatewayFilterFactory,trace=java.lang.IllegalArgumentException:无法在 org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.lambda$loadGatewayFilters 处找到名称为 Hystrix 的 GatewayFilterFactory $3(RouteDefinitionRouteLocator.java:142) 在 java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 在 java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) 在 java.util.stream .AbstractPipeline.copyInto(AbstractPipeline.java:481) 在

What is the cause of it, and what can I do to prevent it?它的原因是什么,我能做些什么来防止它?

Maybe,you should use this dependency也许,你应该使用这个依赖
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> </dependency>

not this one不是这个
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring Cloud Gateway 启动失败:无法找到具有名称的 GatewayFilterFactory<blank> - Spring Cloud Gateway Failed to start: Unable to find GatewayFilterFactory with name <blank> Spring 网关和 Auth0:IllegalArgumentException:找不到名称为 TokenRelay 的 GatewayFilterFactory - Spring Gateway and Auth0: IllegalArgumentException: Unable to find GatewayFilterFactory with name TokenRelay Spring 2.0.0.RELEASE 中的 Mockito 错误 - Mockito Bug in Spring 2.0.0.RELEASE Spring Boot应用程序启动失败并显示2.0.0.RELEASE - Spring Boot application start failed with 2.0.0.RELEASE Spring Boot 2.0.0.RELEASE 中缺少@LocalServerPort - @LocalServerPort missing from Spring Boot 2.0.0.RELEASE SpringBoot 2.0.0.RELEASE上的ServerRequest - ServerRequest on SpringBoot 2.0.0.RELEASE Spring Data Mongo 从 1.9.6.RELEASE 升级到 2.0.0.RELEASE - Spring Data Mongo Upgrade from 1.9.6.RELEASE to 2.0.0.RELEASE Spring 启动外部属性不适用于启动 2.0.0.RELEASE,其中包含 spring 批次 - Spring boot external properties not working for boot 2.0.0.RELEASE with spring batch inside Spring Data Rest 2.0.0.RELEASE以前使用RC1打破代码工作 - Spring Data Rest 2.0.0.RELEASE Breaks Code Working Previously With RC1 Spring Boot 2.0.0.RELEASE java.lang.ClassNotFoundException:org.springframework.aop.framework.AopProxyUtils - Spring boot 2.0.0.RELEASE java.lang.ClassNotFoundException: org.springframework.aop.framework.AopProxyUtils
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM