原文:Spring Cloud ZooKeeper集成Feign的坑1,錯誤:Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.

錯誤如下: 解決方法: 說明:可以封裝一個Cinfig類,最主要是紅色部分的RestTemplate,當然,可以直接在別的地方注入紅色部分代碼即可。而且,如果哪個組件上注解了這個方法,其余都可以不用,只是一次注解即可。 解釋說明: 以上的代碼是從官方的例子代碼發現的:https: github.com spring cloud spring cloud zookeeper blob master ...

2017-09-20 10:19 1 41339 推薦指數:

查看詳情

 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM