spring cloud gateway启动报错Property: spring.cloud.gateway.routes[2].predicates的原因及解决

报错内容如下:

Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.gateway' to org.springframework.cloud.gateway.config.GatewayProperties failed:

    Property: spring.cloud.gateway.routes[2].predicates
    Value: []
    Reason: 不能为空

原因及解决:

geteway的某一个路由里没有写predicates断言,routes[2]就表示第三个路由,在指定的位置加上断言就好了。

gateway的filter并不是必须写的,但predicates是必须写的。

posted on 2020-09-24 10:52  SilenceAries  阅读(8209)  评论(0)    收藏  举报

导航