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是必须写的。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM