日期:2014-05-19  浏览次数:21078 次

求高手解析:org.apache.commons.httpclient.NoHttpResponseException
公司OA系统的日志里经常报NoHttpResponseException,该系统访问的人比较多,经常有人反馈提交数据时数据部分丢失,有时开始提交时报错,但再点提交时却成功了。
org.apache.commons.httpclient.NoHttpResponseException: The server xxx.com.cn failed to respond
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1976)
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:323)
at com.kop.user.filter.AuthenFilter.doFilter(AuthenFilter.java:222)
at com.apusic.web.container.FilterComponent.doFilter(Unknown Source)
at com.apusic.web.container.FilterChainImpl.performFilter(Unknown Source)
at com.apusic.web.container.WebContainer.invoke(Unknown Source)
at com.apusic.web.container.WebContainer.processRequest(Unknown Source)
at com.apusic.web.http.VirtualHost.processRequest(Unknown Source)
at com.apusic.web.http.HttpServer.processRequest(Unknown Source)
at com.apusic.web.http.HttpConnectionHandler.service(Unknown Source)
at com.apusic.web.http.ConnectionHandler.processRequest(Unknown Source)
at com.apusic.web.http.ConnectionHandler.processConnection(Unknown Source)
at com.apusic.web.http.ConnectionHandler.run(Unknown Source)
at com.apusic.util.ThreadPoolImpl$WorkerThread.run(Unknown Source)


------解决方案--------------------
楼主试试先把服务器的最大连接数跟线程数改大一些试试。
------解决方案--------------------
org.apache.commons.httpclient.NoHttpResponseException:

In some circumstances, usually when under heavy load, the web server may be able to receive requests but unable to process them. A lack of sufficient resources like worker threads is a good example. This may cause the server to drop the connection to the client without giving any response. HttpClient throws NoHttpResponseException when it encounters such a condition. In most cases it is safe to retry a method that failed with NoHttpResponseException.