Axis2调用超时Read timed out的解决办法一则

简介:
Axis2调用超时Read timed out的解决办法一则
 

Axis2不是个省油的灯,用起来一直不爽,现在项目快结束了,用着玩意想吐!
 
我是用服务端+客户端存根来使用Axis2的,在存根调用了服务上一个比较耗时的操作时,超时挂了。

首先我就开始在应用服务器JBOSS上到处修改超时时间为600*1000毫秒(10分钟)。可测试时候还继续超时。
 
查看网上,有很多人也遇到我一样的问题,都是增大超时时间,可是在jboss上设置没用啊!
 
最终通过设置存根每个方法的超时时间来解决。虽然很低级,但这样问题却解决了。
 
异常时堆栈信息如下:
14:02:52,582 INFO    [STDOUT] 2009-05-04 14:02:52    - INFO    org.apache.axis2.transport.http.HTTPSender         - Unable to sendViaPost to url[http: //192.168.50.170:80/ccmweb/services/ccmws.ccmwsHttpSoap12Endpoint] 
java.net.SocketTimeoutException: Read timed out 
  at java.net.SocketInputStream.socketRead0(Native Method) 
  at java.net.SocketInputStream.read(SocketInputStream.java:129) 
  at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) 
  at java.io.BufferedInputStream.read(BufferedInputStream.java:235) 
  at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) 
  at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) 
  at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116) 
  at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413) 
  at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973) 
  at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) 
  at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) 
  at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) 
  at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) 
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) 
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) 
  at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542) 
  at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189) 
  at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) 
  at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:364) 
  at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:208) 
  at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448) 
  at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401) 
  at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) 
  at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) 
  at zzvcom.cms.ccm.wsclient.ccmws.CcmwsStub.genProgramPutInfoList(CcmwsStub.java:828) 
  at zzvcom.cms.ccm.wsclient.CcmWSClient.genProgramPutInfoList(CcmWSClient.java:286) 
  at zzvcom.cms.ccm.service.impl.ProgramServiceImpl.getWaitingProgramInfo(ProgramServiceImpl.java:1125) 
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
  at java.lang.reflect.Method.invoke(Method.java:585) 
  at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) 
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) 
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) 
  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) 
  at $Proxy66.getWaitingProgramInfo(Unknown Source) 
  at zzvcom.cms.ccm.action.ProgramAction.stockProgram(ProgramAction.java:2026) 
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
  at java.lang.reflect.Method.invoke(Method.java:585) 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
  at zzvcom.cms.sys.authen.web.AuthFilterForCas.doFilter(AuthFilterForCas.java:128) 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
  at edu.yale.its.tp.cas.client.filter.CASFilter.doFilter(CASFilter.java:87) 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
  at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:78) 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) 
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) 
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) 
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) 
  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) 
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) 
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) 
  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157) 
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) 
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) 
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580) 
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) 
  at java.lang.Thread.run(Thread.java:595) 
Caused by: java.net.SocketTimeoutException: Read timed out 
  at java.net.SocketInputStream.socketRead0(Native Method) 
  at java.net.SocketInputStream.read(SocketInputStream.java:129) 
  at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) 
  at java.io.BufferedInputStream.read(BufferedInputStream.java:235) 
  at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) 
  at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) 
  at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116) 
  at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413) 
  at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973) 
  at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) 
  at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) 
  at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) 
  at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) 
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) 
  at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) 
  at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542) 
  at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender. 


 

解决办法:
 
在存根业务调用代码中进行设置,添加:
_operationClient.getOptions().setTimeOutInMilliSeconds(600000L);
_operationClient表示一个客户端对象。
 
这个设置很不合理,但是没办法了,暂时先解决了问题再研究去。


本文转自 leizhimin 51CTO博客,原文链接:http://blog.51cto.com/lavasoft/155093,如需转载请自行联系原作者
相关文章
错误: 实例 "ahwater-linux-core" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7c1609
错误: 实例 "ahwater-linux-core" 执行所请求操作失败,实例处于错误状态。: 请稍后再试 [错误: Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7c1609c9-9d0f-4836-85b3-cefd45f942a7.
5467 0
|
5月前
|
监控 Serverless Shell
函数计算操作报错合集之 显示"Function timed out after 30 seconds (maxMemoryUsage: 73.38MB)" ,该如何解决
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。
|
6月前
|
Windows
如何在关闭socket连接的时候跳过TIME_WAIT的等待状态
如何在关闭socket连接的时候跳过TIME_WAIT的等待状态
|
Python
pip 安装库失败问题:Retrying (Retry(total=4, connect=None, read=None, redirect=None, status =None)),原因及解决办法
pip 安装库失败问题:Retrying (Retry(total=4, connect=None, read=None, redirect=None, status =None)),原因及解决办法
17290 0
|
网络协议 应用服务中间件
服务器CLOSE_WAIT请求太多的问题
服务器CLOSE_WAIT请求太多的问题
606 0
|
NoSQL Java Redis
记录Redis操作的异常QueryTimeoutException & RedisCommandTimeoutException: Command timed out after 1 min
记录Redis操作的异常QueryTimeoutException & RedisCommandTimeoutException: Command timed out after 1 min
3885 0
|
关系型数据库 MySQL
jdbs学习中的错误总结1(MySql Lock wait timeout exceeded)
错误原因: 两个事物之间出现死锁,导致另外一个事物超时 某一种表频繁被锁表,导致其他事物无法拿到锁,导致事物超时
jdbs学习中的错误总结1(MySql Lock wait timeout exceeded)
|
流计算
四十四、nimbus,supervisor进程自动停止(Read a frame size of ..., which is bigger than the maximum allowable...)
四十四、nimbus,supervisor进程自动停止(Read a frame size of ..., which is bigger than the maximum allowable...)
四十四、nimbus,supervisor进程自动停止(Read a frame size of ..., which is bigger than the maximum allowable...)
|
SQL Oracle 关系型数据库
MySQL:参数wait_timeout和interactive_timeout以及空闲超时的实现
水平有限,如果有误请指出源码版本:percona 5.7.22 一、参数意思 这里简单解释一下两个参数含义如下: interactive_timeout:The number of seconds the server waits for activity on an interactive .
2154 0