No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-netflix-ribbon?

 

 

... 60 common frames omitted
Caused by: java.lang.IllegalStateException: No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-netflix-ribbon?
at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.loadBalance(FeignClientFactoryBean.java:214) ~[spring-cloud-netflix-core-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:232) ~[spring-cloud-netflix-core-1.4.5.RELEASE.jar:1.4.5.RELEASE]
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:178) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
... 70 common frames omitted

 

当时没太注意自己配置,然后一直在报错,断点也看了源码,找不到这个client, 百度过也没人遇到,

解决方法就是配置文件里配的的那个,我选择的okhttp  但是我的项目中是没引入这个jar 。最开始我一直认为我用的是httpclient   。遇到这样的问题,花了2小时才解决,郁闷!

posted @ 2018-08-20 10:56  指针怒草内存栈  阅读(17051)  评论(0编辑  收藏  举报