Could not recover RibbonLoadBalancerClient.choose ServiceInstance

org.springframework.retry.TryException:
Could not recover; nested exception is java.lang.AbstractMethodError: org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.choose(Ljava/lang/String;Lorg/springframework/cloud/client/loadbalancer/Request;)Lorg/springframework/cloud/client/ServiceInstance;

springboot:2.7.18
springcloud:2021.0.4
服务注册中心:Eureka 2.2.9.RELEASE
负载均衡:Ribbon 2.2.9.RELEASE
服务调用:OpenFeign 2.2.9.RELEASE

Eureka 里面的spring-cloud-starter-loadbalancer 和ribbon-eureka中的ribbon-loadbalancer 冲突
原因:spring-cloud-loadbalancer 和 ribbon-balancer 冲突,去除其中一个

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>2.2.9.RELEASE</version>
<exclusions>
<exclusion>
<groupId>ribbon</groupId>
<artifactId>com.netflix.ribbon</artifactId>
</exclusion>
</exclusions>
</dependency>

 

 

参考

OpenFeign 调用服务提供者出现的BUG

posted @ 2024-07-01 20:02  ☆♂安♀★  阅读(16)  评论(0编辑  收藏  举报