gateway启动出现java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name ****

Posted Acmen-zym

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gateway启动出现java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name ****相关的知识,希望对你有一定的参考价值。

具体错误

Caused by: java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name UserToken 
	at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.loadGatewayFilters(RouteDefinitionRouteLocator.java:187) ~[spring-cloud-gateway-core-2.2.2.RELEASE.jar:2.2.2.RELEASE]
	at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.getFilters(RouteDefinitionRouteLocator.java:233) ~[spring-cloud-gateway-core-2.2.2.RELEASE.jar:2.2.2.RELEASE]
	at org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator.convertToRoute(RouteDefinitionRouteLocator.java:170) ~[spring-cloud-gateway-core-2.2.2.RELEASE.jar:2.2.2.RELEASE]
	at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:100) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.tryEmitScalar(FluxFlatMap.java:480) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:413) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.drainLoop(FluxFlatMap.java:704) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.drain(FluxFlatMap.java:580) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapInner.onSubscribe(FluxFlatMap.java:970) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.Flux.subscribe(Flux.java:8357) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:267) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:363) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.Flux.subscribe(Flux.java:8357) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onNext(FluxFlatMap.java:418) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable$IterableSubscription.slowPath(FluxIterable.java:267) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable$IterableSubscription.request(FluxIterable.java:225) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxFlatMap$FlatMapMain.onSubscribe(FluxFlatMap.java:363) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:161) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:86) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.Mono.subscribe(Mono.java:4252) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.Mono.subscribeWith(Mono.java:4363) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]
	at reactor.core.publisher.Mono.subscribe(Mono.java:4083) ~[reactor-core-3.3.12.RELEASE.jar:3.3.12.RELEASE]

1、检查过滤工厂实现类是否命名规范

必须使用GatewayFilterFactory结尾,例如:UserTokenGatewayFilterFactory.java

过滤工厂是以GatewayFilterFactory前端作为Key的

2、检查 yml 配置文件key是否填写正确

-UserToken = true 等于号有空格也会造成无法识别,修改为-UserToken=true即可


以上是关于gateway启动出现java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name ****的主要内容,如果未能解决你的问题,请参考以下文章

IllegalArgumentException: requirement failed: Corrupt index found

Java 阻塞和同步队列

gateway启动出现java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name ****

gateway启动出现java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name ****

gateway启动出现java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name ****

电脑出现502bad gateway怎么解决