com.netflix.client.ClientException: Load balancer does not have available server for client: xxxxx

问题:
ERROR:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.netflix.hystrix.exception.HystrixRuntimeException: SkuFeign#search(Map) failed and no fallback available.] with root cause

com.netflix.client.ClientException: Load balancer does not have available server for client: xxxxx

**

出现该错误的原因为Feign调用中未能找到调取的方法

**


原因一:

启动类中没有以正确的路径找到Feign @EnableFeignClients

@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(basePackages = "com.xm.search.feign")
public class SearchWebApplication{
    public static void main(String[] args) {
        SpringApplication.run(SearchWebApplication.class,args);
    }
}

原因二:

①用于被调用的Feign类未被纳入Spring容器中 @Component
②指定微服务名称错误 @FeignClient

@Component
@FeignClient(name = "search")
@RequestMapping(value = "/search")


原因三:

Feign的微服务模块启动时还没完全启动完成就让其他模块微服务启动



原因四:

查看其它微服务模块,是否出现被feign调用的方法出现错误,如:未开虚拟机,导致前面ServiceImpl等方法无法获取数据库信息等。



更多原因(收纳其他帖子)

1.controller层没有加@ResponseBody
2.Service层实现类未添加注解@Autowired

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值