SpringBoot和SpringCloud版本问题:Load balancer does not have available server for client

转载来源: https://blog.csdn.net/FansUnion/article/details/90635479

Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: crm-service

    at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:468)

    

迁移B项目到A项目,最后发现2个项目Spring*版本不一致,猜测很可能就是这个原因导致的。

    因为,其它能想到的办法都试过了。

 


 
 
  1.   <parent>
  2.         <groupId>org.springframework.boot </groupId>
  3.         <artifactId>spring-boot-starter-parent </artifactId>
  4.         <version>1.5.13.RELEASE </version>
  5.         <relativePath/> <!-- lookup parent from repository -->
  6.     </parent>    
  7.   <dependencyManagement>
  8.         <dependencies>
  9.             <dependency>
  10.                 <groupId>org.springframework.cloud </groupId>
  11.                 <artifactId>spring-cloud-dependencies </artifactId>
  12.                 <version>Edgware.SR4 </version>
  13.                 <type>pom </type>
  14.                 <scope>import </scope>
  15.             </dependency>
  16.         </dependencies>
  17.     </dependencyManagement>  

 
    

"Load balancer does not have available server for client"出现这个问题,可能还有其他原因,网上的解决办法都尝试过了。

所以,最终只能怀疑是版本问题了。

SpringCloud SpringBoot新手上路。

 

在排查过程中,发现一个相关小问题。


@SpringCloudApplication里面嵌套了@SpringBootApplication。
如果需要自定义扫描包路径,放在@SpringCloudApplication的前面。要不然使用的是“@SpringCloudApplication里面的@SpringBootApplication”


@SpringBootApplication(scanBasePackages="com.b")
@SpringCloudApplication

 

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
public @interface SpringCloudApplication {
}

 

自定义路径,是特例,一般也不会遇到这个问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值