错误信息:
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×tamp=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