调用后台接口时,代码报了下错误:
严重: Servlet.service() for servlet [springmvc] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed t
o invoke the method findPage in the service com.service.BrandService. Tried 3 times of the providers [172.16.94.115:20881] (1/1) from the registry 192.168.25.129:2181 on the consum
er 172.16.94.115 using the dubbo version 2.8.4. Last error is: Invoke remote method timeout. method: findPage, provider: dubbo://172.16.94.115:20881/com.service.BrandService?anyhos
t=true&application=tystore-manager-web&check=false&dubbo=2.8.4&generic=false&interface=com.service.BrandService&methods=add,findById,update,findPage,delete,findAll&pid=15116&revisi
on=1.0-SNAPSHOT&side=consumer×tamp=1624929883885, cause: Waiting server-side response timeout. start time: 2021-06-29 09:25:49.385, end time: 2021-06-29 09:25:50.386, client e
lapsed: 0 ms, server elapsed: 1001 ms, timeout: 1000 ms, request: Request [id=17, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=findPage, pa
rameterTypes=[class com.pojo.TbBrand, class java.lang.Integer, class java.lang.Integer], arguments=[com.pojo.TbBrand@7268b2f8, 1, 10], attachments={path=com.service.BrandService, i
nterface=com.service.BrandService, version=0.0.0}]], channel: /172.16.94.115:53263 -> /172.16.94.115:20881] with root cause
com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout. start time: 2021-06-29 09:25:49.385, end time: 2021-06-29 09:25:50.386, client elapsed: 0 ms, ser
ver elapsed: 1001 ms, timeout: 1000 ms, request: Request [id=17, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=findPage, parameterTypes=[cla
ss com.pojo.TbBrand, class java.lang.Integer, class java.lang.Integer], arguments=[com.pojo.TbBrand@7268b2f8, 1, 10], attachments={path=com.service.BrandService, interface=com.serv
ice.BrandService, version=0.0.0}]], channel: /172.16.94.115:53263 -> /172.16.94.115:20881
在检查过以下内容后:
- POJO序列化
- 本地IP与服务IP
- dubbo运行状态
- 关闭防火墙
最后的原因居然是服务器性能不够,响应时间长,自动超时。
@Service(
interfaceName = "com.service.BrandService",
timeout = 600000)
在service上设置超时时间后,便正常了,,,,