hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Natarajan_Va...@emc.com>
Subject connection reset issue
Date Mon, 11 Jan 2010 06:01:11 GMT
There are 2 threads send requests to a server simultaneously. After a
while one of the threads (same thread every time) closes the connection
and throws following exception and other thread seems to run fine and
server is alive too.

 

I'm using version 3.0.1. I could not send context log.....

 

Caused by: java.net.SocketException: Connection reset

                at
java.net.SocketInputStream.read(SocketInputStream.java:168)

                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:77)

                at
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105)

                at
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.jav
a:1115)

                at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpCon
nectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1373)

                at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBa
se.java:1832)

                at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase
.java:1590)

                at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java
:995)

                at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMe
thodDirector.java:397)

                at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMetho
dDirector.java:170)

                at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
96)

                at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:3
24)

 

Use MultiThreadedHttpConnectionManager

 

        m_multiThreadedHttpConnectionManager = new
MultiThreadedHttpConnectionManager();

 
m_multiThreadedHttpConnectionManager.getParams().setDefaultMaxConnection
sPerHost(10);

 
m_multiThreadedHttpConnectionManager.getParams().setMaxTotalConnections(
50);

        m_client = new HttpClient(m_multiThreadedHttpConnectionManager);

 

Both threads execute PostMethod.

 

Has anyone else experience this problem? Any idea what might cause this
issue? 

 

Thanks

Valli

 

 

Thanks

Valli

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message