dubbo服务RpcException异常:Tried 3 times of the providers 或com.alibaba.dubbo.remoting.TimeoutException:
来源:互联网 发布:快普软件 编辑:程序博客网 时间:2024/05/18 20:49
异常信息:
Could not complete request
com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method getUserByPrimaryKey in the service com.dubbo.common.service.UserService. Tried 3 times of the providers [192.168.4.118:20880] (1/1) from the registry 127.0.0.1:2181 on the consumer 192.168.4.118 using the dubbo version 2.5.3. Last error is: Invoke remote method timeout. method: getUserByPrimaryKey, provider: dubbo://192.168.4.118:20880/com.dubbo.common.service.UserService?anyhost=true&application=dubboWeb&check=false&dubbo=2.5.3&interface=com.dubbo.common.service.UserService&methods=update,getUserByPrimaryKey,getUser,delete,getById,findPage,add,getUsers&pid=1156&revision=0.0.1-SNAPSHOT&side=consumer×tamp=1492760542657, cause: Waiting server-side response timeout. start time: 2017-04-21 15:48:37.322, end time: 2017-04-21 15:48:38.325, client elapsed: 1 ms, server elapsed: 1001 ms, timeout: 1000 ms,
Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout by scan timer.
最近在做一个项目,为了方便系统分离合并,采用dubbo实现,在debug测试过程中每次调用dubbo服务时就会产生异常,调用后台执行了三次,也就是服务调了三次,看后台总是看到一个tried 3 times……这也正是产生三次的原因,后来仔细看了后台异常说的是……timeout……,那么自然想到是服务超时,个人觉得是在调用一次服务时,后台需要执行的时间太长,超出了服务的响应超时时间(response timeout),所以它会再次尝试调用服务,可能是dubbo服务的设置,最多尝试三次,所以就会产生调用三次服务,修改dubbo服务的超时时间timeout,网上找设置dubbo timeout的方法,http://wenku.baidu.com/view/5c6854287375a417866f8f61,这里边仔细介绍了设置超时时间的方法,还进行了详细分析,开始设置的timeout=10000,少量的可以正常完成,可是数大点就不行了,后来有同事说可以设置timeout=0就没有超时时间,但是测试过,不可以,因为默认的是500,你设置了0,就是不管怎样都是超时了,这个和其他框架的配置不太一样,后来在服务提供端设置timeout=1200000,ok!完胜!虽然有点大,但是也没影响。一般情况设置为3000毫秒。
详细设置和说明可以查看百度文库的资料,dubbo官方配置指南.doc,
<dubbo:service interface="com.XXXX.XXXXX.CardService" ref="cardService" timeout="1200000"/>
如果报错信息中有Serializable关键字,有可能是实体类没有序列化,dubbo是远程调用实现,在传输对象过程中,被传输的对象必须实现序列化,即 public class User implements Serializable {}。
- dubbo服务RpcException异常:Tried 3 times of the providers 或com.alibaba.dubbo.remoting.TimeoutException:
- com.alibaba.dubbo.remoting.TimeoutException
- 坑之关于dubbo服务产生异常之:Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side respons
- dubbo出现com.alibaba.dubbo.remoting.TimeoutException解决办法。
- 关于dubbo服务产生错误之:Caused by: com.alibaba.dubbo.remoting.TimeoutException: Waiting s
- com.alibaba.dubbo.rpc.RpcException
- com.alibaba.dubbo.rpc.RpcException的解决方法
- DUBBO的com.alibaba.dubbo.rpc.RpcException远程调用异常解决方法
- dubbo启动服务报错com.alibaba.dubbo.rpc.RpcException及Address already in use
- dubbo:com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 解决
- dubbo+zookeeper报错:com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method
- DUBBO的com.alibaba.dubbo.rpc.RpcException解决方法
- 使用dubbo报错:com.alibaba.dubbo.rpc.RpcException
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 错误处理
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 错误处理
- com.alibaba.dubbo.rpc.RpcException: Forbid consumer 18.18.16.229 access service com.alibaba.dubbo.mo
- bug宝典Java篇 com.alibaba.dubbo.rpc.RpcException
- 调用Dubbo服务报以下错误(com.alibaba.dubbo.remoting.RemotingException),问题原因和解决办法
- Elasticsearch 环境搭建
- 关于python 的继承
- Appium 1.5.3下Could Not Launch Appium Inspector的解决办法
- 卷积神经网络实战(可视化部分)——使用keras识别猫咪
- SVG简介
- dubbo服务RpcException异常:Tried 3 times of the providers 或com.alibaba.dubbo.remoting.TimeoutException:
- TCP/IP笔记(五)IP协议相关技术
- 安卓中小区广播填加预制频段
- Color the ball
- 基于Spring提供支持不同设备的页面
- 12345678910....n
- 基于Spring的设备类型检查
- 跟我学JavaScript--字符串对象属性具体讲解
- 使用git将本地与coding下仓库同步