项目场景:

学Dubbo,运行测试provider和consumer


问题描述:

昨天晚上回寝室之前还正常运行,今天早上来开机后运行就报错

com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service com.itheima.service.HelloService. Tried 3 times of the providers [192.168.54.1:20880] (1/1) from the registry 192.168.54.128:2181 on the consumer 192.168.54.1 using the dubbo version 2.6.0. Last error is: Invoke remote method timeout. method: sayHello, provider: dubbo://192.168.54.1:20880/com.itheima.service.HelloService?anyhost=true&application=dubbodemo_consumer&check=false&dubbo=2.6.0&generic=false&interface=com.itheima.service.HelloService&methods=sayHello&pid=12196&register.ip=192.168.54.1&remote.timestamp=1604241559395&side=consumer&timestamp=1604279347465, cause: Waiting server-side response timeout. start time: 2020-11-02 09:09:40.053, end time: 2020-11-02 09:09:41.054, client elapsed: 0 ms, server elapsed: 1001 ms, timeout: 1000 ms, request: Request [id=2, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=sayHello, parameterTypes=[class java.lang.String], arguments=[itcast], attachments={path=com.itheima.service.HelloService, interface=com.itheima.service.HelloService, version=0.0.0}]], channel: /192.168.54.1:1926 -> /192.168.54.1:20880
Failed to invoke the method sayHello in the service com.itheima.service.HelloService.


原因分析:

服务器端没有关闭网络防火墙


解决方案:

用service iptables stop命令关闭网络防火墙,然后运行成功
Failed to invoke the method sayHello in the service com.itheima.service.HelloService.

相关文章: