繁体   English   中英

Spring Cloud Gateway 启动失败:无法找到具有名称的 GatewayFilterFactory<blank>

[英]Spring Cloud Gateway Failed to start: Unable to find GatewayFilterFactory with name <blank>

Spring Cloud Gateway 启动失败,出现如下异常:

service-gateway      | 2020-01-02 13:44:55.910  INFO 22 --- [           main] c.n.discovery.InstanceInfoReplicator     : InstanceInfoReplicator onDemand update allowed rate per min is 4
service-gateway      | 2020-01-02 13:44:55.915  INFO 22 --- [           main] com.netflix.discovery.DiscoveryClient    : Discovery Client initialized at timestamp 1577943895914 with initial instances count: 11
service-gateway      | 2020-01-02 13:44:55.916  INFO 22 --- [           main] o.s.c.n.e.s.EurekaServiceRegistry        : Registering application SERVICE-GATEWAY with eureka with status UP
service-gateway      | 2020-01-02 13:44:55.917  INFO 22 --- [           main] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1577943895917, current=UP, previous=STARTING]
service-gateway      | 2020-01-02 13:44:55.923  INFO 22 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_SERVICE-GATEWAY/a5881e80ffd5:service-gateway:1790: registering service...
service-gateway      | 2020-01-02 13:44:55.991  INFO 22 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_SERVICE-GATEWAY/a5881e80ffd5:service-gateway:1790 - registration status: 204
service-gateway      | 2020-01-02 13:44:56.051  WARN 22 --- [           main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'eurekaAutoServiceRegistration'; nested exception is reactor.core.Exceptions$ErrorCallbackNotImplemented: java.lang.IllegalArgumentException: Unable to find GatewayFilterFactory with name 
service-gateway      | 2020-01-02 13:44:56.083  INFO 22 --- [           main] com.netflix.discovery.DiscoveryClient    : Shutting down DiscoveryClient ...
service-gateway      | 2020-01-02 13:44:59.085  INFO 22 --- [           main] com.netflix.discovery.DiscoveryClient    : Unregistering ...
service-gateway      | 2020-01-02 13:44:59.093  INFO 22 --- [           main] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_SERVICE-GATEWAY/a5881e80ffd5:service-gateway:1790 - deregister  status: 200
service-gateway      | 2020-01-02 13:44:59.104  INFO 22 --- [           main] com.netflix.discovery.DiscoveryClient    : Completed shut down of DiscoveryClient

在用于创建过滤器的 spring 云网关代码中,它说:

GatewayFilterFactory factory = this.gatewayFilterFactories.get(definition.getName());
                    if (factory == null) {
                        throw new IllegalArgumentException("Unable to find GatewayFilterFactory with name " + definition.getName());
                    }

因此,如果无法创建网关过滤器工厂,则异常应给出一条消息:

“无法找到名称为<some name> GatewayFilterFactory ”,但我的日志中没有这样的东西,只是“无法找到名称为“的 GatewayFilterFactory”。 经过2天的研究,我终于发现,我的配置文件中有一个错误:

        - id:  api_assets
          uri: lb://BACKEND
          predicates:
            - Path=/api/assets/**
          filters:
            - name: AuditFilter
            -

带有空白的过滤器名称列表

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM