Axis2 java web服务客户端超时后引起的问题
我有以下问题:
- 生成语音 XML 的 Java Web 应用程序 - 基于 struts - 部署在 IBM WebSphere AS (WAS v.7.0.0.7) 上。
- 该应用程序使用 Axis2 java - v.1.5 - Web 服务客户端来调用驻留在 WebLogic AS 上的 Web 服务。
- 我使用以下方法将超时设置为 1000 毫秒:
stub.getServiceClient().getOptions().setTimeOutInMilliSeconds(1000);
- 应用程序访问 Web 服务的最大次数约为每小时 25,000 次 - 大约 7 个并发调用。
- 将调用 Web 服务的代码放入 try-catch 块后,我捕获异常并从该方法返回。
- 平均而言,WAS 上每小时会抛出约 200 个异常,因为计时器在打开连接或读取 Web 服务调用结果时过期 - 通过日志记录,
exception.getMessage();
我得到以下任一信息,主要是第一个:
org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 60000 ms
或
org.apache.axis2.AxisFault: Read timed out
- 问题是一段时间后,应用程序服务器挂起,不响应传入请求,或在一段时间后响应,这使我们重新启动应用服务器,10天内发生了3次左右。
- 查看日志,除了由于超时而捕获的异常之外,我什么也没发现,也许还有更多的内容,但我还没有找到。
- 在上述情况下我应该考虑什么指导点吗?如果没有的话,我可以编写一个清理代码来释放连接吗?从上面的描述我们是否可以确定问题的根本原因呢?应用程序服务器的行为是否“正常”?
对于冗长的描述/问题,我深表歉意,我始终感谢您的帮助!
I have the following issue:
- A java web application that generate Voice XML - based on struts - deployed on IBM WebSphere AS (WAS v.7.0.0.7).
- The application uses Axis2 java - v.1.5 - web service client to invoke a web service resides on WebLogic AS.
- I set the timeout to 1000 ms using :
stub.getServiceClient().getOptions().setTimeOutInMilliSeconds(1000);
- The maximum number of times the application hits the web service is about 25,000 per hour - about 7 concurrent calls.
- After putting the code that invoke the web service in a try-catch block, i catch the exception and return from the method.
- On average, about 200 exceptions are thrown - on WAS - per hour because of the timer expire either in opening the connection or reading the result of the web service invocation
- By logging
exception.getMessage();
I get either one of the following, mostly the first:
org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 60000 ms
or
org.apache.axis2.AxisFault: Read timed out
- The problem is after a while, the application server hangs, doesn't respond to incoming requests, or respond after a while,which makes us restart the application server, it happened about 3 times in 10 days.
- Looking through the logs, I found nothing except the exceptions caught because of the expiry of the timeout, maybe there is something that says more, but i haven't found it yet.
- Are there any guiding points I should consider in the above scenario? is there a clean-up code i could write to release the connection if it wasn't? Can we determine the root cause of the problem from the above description? Is the behavior of the application server "normal"?
I apologize for the long description/question, I always appreciate your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,服务器报告的超时错误为 60000 毫秒。巧合的是,这 60 秒是 IBM IHS 服务器的默认超时,因此您的问题很可能与此有关。
假设您希望服务器上处理请求的时间超过 60 秒,您可以通过编辑 /opt/WebSphere70/Plugin/config/SERVERNAME/plugin-cfg.xml 来增加此超时,
查找 ServerIOTimeout="60" 并更改值大于 60 秒。
[编辑]
您也可以通过管理控制台查看此设置...
服务器>网络服务器>服务器名称>插件属性
From what I understand, the tineout error is being reported from the Server as 60000ms. Coincidentally, this 60 seconds is the default timout for the IBM IHS server so your issue could well be with that.
Assuming that you want your requests to take longer than 60 seconds to process on the server you can increase this timeout by editing /opt/WebSphere70/Plugin/config/SERVERNAME/plugin-cfg.xml
Look for ServerIOTimeout="60" and change the value to greater than 60 seconds.
[edit]
You can view this setting via the Admin console as well...
Servers > Web servers > SERVERNAME > Plug-in properties