报错如下:
Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2020-10-03 21:54:18.684 ERROR 14604 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Failed to bind properties under ‘zuul.routes’ to java.util.Map<java.lang.String, org.springframework.cloud.netflix.zuul.filters.ZuulProperties$ZuulRoute>:
Reason: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, org.springframework.cloud.netflix.zuul.filters.ZuulProperties$ZuulRoute>]
Action:
Update your application’s configuration
解决方法:
配置网关的application.yml里的Zuul时出现错误
zuul:
prefix: /api #添加路由前缀
retryable: true
routes:
忘记添加微服务的映射了
zuul:
prefix: /api # 添加路由前缀
retryable: true
routes:
item-service: /item/** # 将商品微服务映射到/item/**