dubbo连接超时问题,求帮忙解决

已解决,我自己看日志,发现是数据库连接失败的问题。请勿回答。

dubbo连接超时设置timeout="12000"也提示超时。

要读取的数据量不大,不超过1000条。
以下是提示错误

五月 18, 2019 2:14:40 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [huigou-manager] in context with path [] threw exception [Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method getItemList in the service com.huigou.interfaces.HgProductService. Tried 3 times of the providers [192.168.25.1:20880] (1/1) from the registry 192.168.25.128:2181 on the consumer 192.168.25.1 using the dubbo version 2.5.3. Last error is: Invoke remote method timeout. method: getItemList, provider: dubbo://192.168.25.1:20880/com.huigou.interfaces.HgProductService?anyhost=true&application=huigou-web&check=false&dubbo=2.5.3&interface=com.huigou.interfaces.HgProductService&methods=addItem,getItemList,getItemCatList,editItem,deleteitem,upitem,downitem,getProductDesc&pid=3112&revision=0.0.1-SNAPSHOT&side=consumer&timeout=12000&timestamp=1558160001720, cause: Waiting server-side response timeout. start time: 2019-05-18 14:14:28.523, end time: 2019-05-18 14:14:40.524, client elapsed: 0 ms, server elapsed: 12001 ms, timeout: 12000 ms, request: Request [id=3, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=getItemList, parameterTypes=[int, int], arguments=[1, 30], attachments={path=com.huigou.interfaces.HgProductService, interface=com.huigou.interfaces.HgProductService, version=0.0.0, timeout=12000}]], channel: /192.168.25.1:62721 -> /192.168.25.1:20880] with root cause
com.alibaba.dubbo.remoting.TimeoutException: Waiting server-side response timeout. start time: 2019-05-18 14:14:28.523, end time: 2019-05-18 14:14:40.524, client elapsed: 0 ms, server elapsed: 12001 ms, timeout: 12000 ms, request: Request [id=3, version=2.0.0, twoway=true, event=false, broken=false, data=RpcInvocation [methodName=getItemList, parameterTypes=[int, int], arguments=[1, 30], attachments={path=com.huigou.interfaces.HgProductService, interface=com.huigou.interfaces.HgProductService, version=0.0.0, timeout=12000}]], channel: /192.168.25.1:62721 -> /192.168.25.1:20880

at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:107)
    at com.alibaba.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:84)
    at com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:96)
    at com.alibaba.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:144)
    at com.alibaba.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:74)
    at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    at com.alibaba.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:53)
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    at com.alibaba.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:48)
    at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:91)
    at com.alibaba.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:53)
    at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:77)
    at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:227)
    at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:72)
    at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
    at com.alibaba.dubbo.common.bytecode.proxy1.getItemList(proxy1.java)
    at com.huigou.controller.HgProductController.getItemList(HgProductController.java:40)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
以下是dubbo配置
    <dubbo:application name="huigou-manager" />
    <dubbo:registry protocol="zookeeper"
        address="192.168.25.128:2181" /> 
    <!-- 用dubbo协议在20880端口暴露服务 -->
    <dubbo:protocol name="dubbo" port="20880" /> 
    <!-- 声明需要暴露的服务接口
    商品服务 -->
    <bean id="hgProductService"
        class="com.huigou.service.HgProductServiceImpl"></bean>
    <dubbo:service
        interface="com.huigou.interfaces.HgProductService" ref="hgProductService" timeout="12000"/>
         <bean id="hgMaUserService"
        class="com.huigou.service.HgMaUserServiceImpl"></bean>
    <dubbo:service
        interface="com.huigou.interfaces.HgMaUserService" ref="hgMaUserService" /> 

<!-- 引用dubbo服务 -->
    <dubbo:application name="huigou-web" />
    <dubbo:registry protocol="zookeeper"
        address="192.168.25.128:2181" />
    <dubbo:reference
        interface="com.huigou.interfaces.HgProductService"
        id="hgProductService" /> 
            <dubbo:reference
        interface="com.huigou.interfaces.HgMaUserService"
        id="hgMaUserService" /> 

2个回答

我已经解决了。是数据库连接的问题。

你可以刷新重试,或者重新连接

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问