异常信息
2022-04-26 16:09:42.307 INFO 1 --- [nio-8080-exec-1] c.n.l.DynamicServerListLoadBalancer : DynamicServerListLoadBalancer for client OperationServiceI initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=OperationServiceI,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:com.netflix.loadbalancer.ConfigurationBasedServerList@1c9c833e
2022-04-26 16:09:42.451 ERROR 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: OperationServiceI] with root cause
com.netflix.client.ClientException: Load balancer does not have available server for client: OperationServiceI
at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:483) ~[ribbon-loadbalancer-2.3.0.jar!/:2.3.0]
at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.3.0.jar!/:2.3.0]
at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.3.0.jar!/:2.3.0]
at rx.Observable.unsafeSubscribe(Observable.java:10327) ~[rxjava-1.3.8.jar!/:1.3.8]
异常原因
controller实现fegin接口时,因为请求路径的问题,去除了@RestController注解,导致服务无法访问
解决办法
参考:https://blog.csdn.net/zhou_zhao_xu/article/details/124432728?spm=1001.2014.3001.5501