DUBBO的com.alibaba.dubbo.rpc.RpcException远程调用异常解决方法

来源:互联网 发布:完美红颜进阶数据 编辑:程序博客网 时间:2024/05/24 03:20

远程调用失败问题:

Caused by: com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method subscribe in the service com.alibab

a.dubbo.registry.RegistryService. Tried 3 times of the providers[172.168.1.167:2181] (1/1) from the registry

172.168.1.167:2181 on the consumer 169.254.249.102 using the dubbo version2.4.9. Last error is: Invoke remote

method timeout.

解决方法一:

这个是由于dubbo接口中的的传输对象没有被序列化而导致的,只需要要检查dubbo接口中参数中的实体类实现序列化(implementsSerializable)就可以解决这一个异常.

解决方法二:

解决这个问题这个只需要重新暴露服务,在Zk上注册服务提供者信息即可。具体就是要排查服务提供者可能出现的问题,解决后部署并重启服务提供者即可。
如果你只是接口服务的使用者,那么这个问题就不是你的,应该是大数据接口的提供者的问题,找他重启下服务,重新发布下接口试试

解决方法三:

1.基本就是dubbo provider没有启动会造成这种情况。

2.api和service是同一个项目,并不是俩项目。

通过启动api,run on server是不能启动service的,必须通过config/startConfig.java,debug as java application启动。

3.启动思路总结:

1.api通过run on server启动

2.service通过startConfig.java启动。debug as java application




1 0