spring cloud gateway 报错 Unable to find GatewayFilterFactory with name

Unable to find GatewayFilterFactory with name xxx
原因是过滤器名称导致的...
spring 约定过滤器类名"xxx"+GatewayFilterFactory,其中"xxx"为配置中的name;

  • 配置文件中
filters:
            - name: ValidateCodeFilter

改成

filters:
            - name: ValidateCode
  • 过滤器类名
public class ValidateCodeFilter  extends AbstractGatewayFilterFactory {
}

改成

public class ValidateCodeGatewayFilterFactory extends AbstractGatewayFilterFactory {
}
 

链接:https://www.jianshu.com/p/61ad2d3317b1
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

posted on 2021-05-17 18:19  duanxz  阅读(5305)  评论(0编辑  收藏  举报