Dubbo服务调用Failed to invoke the method错误记录

在多模块项目中使用Dubbo进行服务调用时,通过Fiddler模拟外部请求出现Failed to invoke the method错误。检查发现并非网络、配置或服务本身问题,最终解决方案在于Windows系统的hosts文件为空,填充正确内容后问题解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

图片解答来自: 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

问题解决。
环境问题坑死人!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值