1. 程式人生 > >Dubbo服務呼叫Failed to invoke the method錯誤記錄

Dubbo服務呼叫Failed to invoke the method錯誤記錄

Dubbo服務呼叫Failed to invoke the method錯誤記錄

在開發過程中我遇到一個問題:
一個多模組專案,服務與應用之間採用dubbo進行呼叫,啟動服務後用瀏覽器訪問一切都好,但當採用fiddler進行模擬外系統請求時卻死活調不通,報錯如下:

[ERROR] [2018-05-14 15:00:59] [com.ztesoft.zop.operator.controller.dispatch.DispatchController:143] - 710000001:Failed to invoke the method getParamVal in the service com.ztesoft.zop.common.service.ICacheService. Tried 1 times of the providers [192.168.8.95:20891] (1/1) from the registry 127.0.0.1:2181 on the consumer 192.168.8.95 using the dubbo version 5.0.3.2-SNAPSHOT. Last error is: Invoke remote method timeout. method: getParamVal, ……

百度 Failed to invoke the method 得到如下解答:
https://blog.csdn.net/wjb_2016/article/details/51084916

圖片解答來自: https://blog.csdn.net/wjb_2016/article/details/51084916

但我排查後均未發現問題,最後發現問題在與系統的hosts配置:
C:\Windows\System32\drivers\etc 目錄下有個hosts檔案,在前幾天我剛重灌了win10的系統,重灌後的系統hosts檔案內容為空(不能確定是否為win10普遍現象),在hosts檔案中寫入
127.0.0.1 localhost

問題解決。
環境問題坑死人!