1. 首页 > 知识 > 技术

Spring Gateway 根据服务名路由失败Whitelabel Error Page,This application has no configured error view

在gateway路由微服务,请求微服务接口时,出现如下错误:


Whitelabel Error Page

This application has no configured error view, so you are seeing this as a fallback.


Wed Aug 28 11:58:27 CST 2024


[efe66cff-2] There was an unexpected error (type=Service Unavailable, status=503).


出现问题的原因是springcloud2021弃用了Ribbon,在2021版本nacos删除了Ribbon,所以无法通过lb路由到指定为服务,需要我们自己引入loadbalancer包


<dependency>

    <groupId>org.springframework.cloud</groupId>

    <artifactId>spring-cloud-starter-loadbalancer</artifactId>

</dependency>

引入后问题得到解决!!!


本文由傻鸟发布,不代表傻鸟立场,转载联系作者并注明出处:https://shaniao.net/jishu/667.html

加载中~

联系我们

在线咨询:点击这里给我发消息

微信号:

工作日:10:30-15:30,节假日休息