网关升级spring boot项目后,启动网关报错,具体报错信息如下:
2021-12-06 09:06:25.335 ERROR 45102 --- [oundedElastic-3] reactor.core.publisher.Operators : Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name Hystrix
Caused by: java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name Hystrix
at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.loadGatewayFilters(RouteDefinitionRouteLocator.java:130) ~[spring-cloud-gateway-server-3.0.1.jar:3.0.1]
at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.getFilters(RouteDefinitionRouteLocator.java:172) ~[spring-cloud-gateway-server-3.0.1.jar:3.0.1]
at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.convertToRoute(RouteDefinitionRouteLocator.java:117) ~[spring-cloud-gateway-server-3.0.1.jar:3.0.1]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmitScalar(FluxFlatMap.java:487) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:420) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.drain(FluxMergeSequential.java:432) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxMergeSequential$MergeSequentialMain.innerNext(FluxMergeSequential.java:304) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxMergeSequential$MergeSequentialInner.onNext(FluxMergeSequential.java:571) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFilter$FilterSubscriber.onNext(FluxFilter.java:113) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:220) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:247) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:711) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:587) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFlatMap$FlatMapInner.onNext(FluxFlatMap.java:993) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1771) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:128) [reactor-core-3.4.2.jar:3.4.2]
at org.springframework.cloud.commons.publisher.FluxFirstNonEmptyEmitting$FirstNonEmptyEmittingSubscriber.onComplete(FluxFirstNonEmptyEmitting.java:325) [spring-cloud-commons-3.0.1.jar:3.0.1]
at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.onComplete(FluxSubscribeOn.java:165) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxIterable$IterableSubscription.fastPath(FluxIterable.java:360) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.requestUpstream(FluxSubscribeOn.java:130) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.onSubscribe(FluxSubscribeOn.java:123) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:164) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.Flux.subscribe(Flux.java:8147) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:199) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.MonoFlatMapMany.subscribeOrReturn(MonoFlatMapMany.java:49) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxFromMonoOperator.subscribe(FluxFromMonoOperator.java:76) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.publisher.FluxSubscribeOn$SubscribeOnSubscriber.run(FluxSubscribeOn.java:193) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84) [reactor-core-3.4.2.jar:3.4.2]
at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37) [reactor-core-3.4.2.jar:3.4.2]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_301]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_301]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_301]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_301]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_301]
第一个解决方法
去掉application.yml配置default-filters配置即可
spring:
cloud:
gateway:
discovery:
locator:
enabled: true
# default-filters:
# - name: Hystrix
# args:
# name : default
# fallbackUri: 'forward:/defaultFallback'
第二个方法
自定义过滤器整合hystrix:重新实现一遍HystrixGatewayFilterFactory文章来源:https://www.toymoban.com/news/detail-625820.html
文章来源地址https://www.toymoban.com/news/detail-625820.html
到了这里,关于JAVA-spring boot 2.4.X报错Unable to find GatewayFilterFactory with name Hystrix的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!