当前位置: 首页 > news >正文

JAVA-spring boot 2.4.X报错Unable to find GatewayFilterFactory with name Hystrix

网关升级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

 

http://www.lryc.cn/news/110232.html

相关文章:

  • 运输层---UDP协议
  • 【LeetCode】剑指 Offer Ⅱ 第3章:字符串(7道题) -- Java Version
  • 【python】绘图代码模板
  • RTT学习笔记12-KConfig 语法学习
  • 基于Mediapipe的姿势识别并同步到Unity人体模型中
  • Linux下进程的特点与环境变量
  • 以Llama-2为例,在生成模型中使用自定义LogitsProcessor
  • python 计算图片hash 缓存图片为key
  • 制造型企业如何实现车间设备生产数据的实时采集?需要5G网络吗?
  • 第2章 HTML中的JavaScript
  • 景联文科技高质量成品数据集上新啦!
  • flask------请求拓展
  • 大数据-玩转数据-FLINK-从kafka消费数据
  • 介绍Sping Boot的5个扩展点
  • Linux2.6内核配置说明
  • Pytest简介及jenkins集成
  • 【LeetCode】105. 从前序与中序遍历序列构造二叉树 106. 从中序与后序遍历序列构造二叉树
  • 堆内存和一些检测工具
  • 【JavaScript】元素获取指南
  • uniapp 返回上一页并刷新
  • Java阶段五Day21
  • 2023,谁在引领实时互动进入高清时代?
  • STM32(HAL)串口中断接收
  • word转pdf怎么转?几种常用方法分享
  • 自学(黑客)技术,入门到入狱!
  • js 函数、闭包及函数对象
  • SSM(Vue3+ElementPlus+Axios+SSM前后端分离)--搭建Vue 前端工程[二]
  • Android 之 AudioManager ( 音频管理器 )
  • 2023爱分析·超自动化厂商全景报告|爱分析报告
  • 【C++进阶知识】04 - 函数默认实参、默认初始化、initializer_list