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.youkuaiyun.com/wjb_2016/article/details/51084916
但我排查后均未发现问题,最后发现问题在与系统的hosts配置:
C:\Windows\System32\drivers\etc 目录下有个hosts文件,在前几天我刚重装了win10的系统,重装后的系统hosts文件内容为空(不能确定是否为win10普遍现象),在hosts文件中写入
127.0.0.1 localhost
问题解决。
环境问题坑死人!
在多模块项目中使用Dubbo进行服务调用时,通过Fiddler模拟外部请求出现Failed to invoke the method错误。检查发现并非网络、配置或服务本身问题,最终解决方案在于Windows系统的hosts文件为空,填充正确内容后问题解决。
1327

被折叠的 条评论
为什么被折叠?



