com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 错误处理

错误信息:

HTTP Status 500 - Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findAll in the service com.pinyougou.sellergoods.service.BrandService. Tried 3 times of the providers [192.168.187.1:20881] (1/1) from the registry 192.168.25.128:2181 on the consumer 192.168.187.1 using the dubbo version 2.8.4. Last error is: Invoke remote method timeout. method: findAll, provider: dubbo://192.168.187.1:20881/com.pinyougou.sellergoods.service.BrandService?anyhost=true&application=pinyougou-manager-web&check=false&dubbo=2.8.4&generic=false&interface=com.pinyougou.sellergoods.service.BrandService&methods=findAll&pid=14128&revision=0.0.1-SNAPSHOT&side=consumer&timestamp=1557363743568, cause: Waiting server-side response timeout by scan timer. start time: 2019-05-09 09:02:37.907, end time: 2019-05-09 09:02:38.933, client elapsed: 1 ms, server elapsed: 1025 ms, timeout: 1000 ms, request: Request [id=2, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=findAll, parameterTypes=[], arguments=[], attachments={path=com.pinyougou.sellergoods.service.BrandService, interface=com.pinyougou.sellergoods.service.BrandService, version=0.0.0}]], channel: /192.168.187.1:14609 -> /192.168.187.1:20881

解决办法:

错误原因1:引用的pojo对象没有序列化,只需将对应的pojo类实现序列化接口即可

public class TbBrand implements Serializable{

}

错误原因2:数据库连接失败,现在mysql已经有了8.0版本,但是有时我们引用的mysql-connector-java-5.0.x.jar包是不可以正常的链接数据库的,因此我们只要将jar包修改就行了。

//此处需要注意多了个    cj
jdbc.driver=com.mysql.cj.jdbc.Driver



jdbc.url=jdbc:mysql://localhost:3306/db?useSSL=true
jdbc.username=root
jdbc.password=123456

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值