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

 

 

... 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 omittedjava

 

當時沒太注意本身配置,而後一直在報錯,斷點也看了源碼,找不到這個client, 百度過也沒人遇到,spring

解決方法就是配置文件裏配的的那個,我選擇的okhttp  可是個人項目中是沒引入這個jar 。最開始我一直認爲我用的是httpclient   。遇到這樣的問題,花了2小時才解決,鬱悶!.net

相關文章
相關標籤/搜索