Java之SpringCloud Eurka注冊錯誤解決方案
學(xué)習(xí)SpringCloud時,在Eurka中注冊時出現(xiàn)的錯誤:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-10-04 11:15:19.703 ERROR 34860 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field discoveryClient in cn.itcast.consumer.web.ConsumerController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found. The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true) Action: Consider defining a bean of type 'com.netflix.discovery.DiscoveryClient' in your configuration.
錯誤代碼:
import com.netflix.discovery.DiscoveryClient; @Autowired private DiscoveryClient discoveryClient;
錯誤原因:導(dǎo)錯了jar包

正確代碼:
import org.springframework.cloud.client.discovery.DiscoveryClient; @Autowired private DiscoveryClient discoveryClient;
到此這篇關(guān)于Java之SpringCloud Eurka注冊錯誤解決方案的文章就介紹到這了,更多相關(guān)Java之SpringCloud Eurka注冊錯誤內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Java數(shù)據(jù)結(jié)構(gòu)與算法入門實例詳解
這篇文章主要介紹了Java數(shù)據(jù)結(jié)構(gòu)與算法入門實例詳解,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-03-03
Flutter實現(xiàn)文本組件、圖標(biāo)及按鈕組件的代碼
這篇文章主要介紹了Flutter實現(xiàn)文本組件、圖標(biāo)及按鈕組件的代碼,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價值 ,需要的朋友可以參考下2019-07-07
kafka消費者kafka-console-consumer接收不到數(shù)據(jù)的解決
這篇文章主要介紹了kafka消費者kafka-console-consumer接收不到數(shù)據(jù)的問題及解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-03-03
maven package 打包報錯 Failed to execute goal的解決
這篇文章主要介紹了maven package 打包報錯 Failed to execute goal的解決,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-11-11

