Ortwin,

   It seems from the wire logs I gathered, that's the normal behaviour.

   I am creating a new HttpMethod object for every send.

   Only when I receive the response, then releaseConnection was called.

   Here's the code :
=================================
//convert trade to xml
        String xmlStr = convertTradeToXMLString(trade, some1id, someid);

PostMethod post = new PostMethod(urlAddress);
post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
post.setRequestHeader ("Authorization", "Basic " + encoding);
post.setRequestHeader("HTTP-Version", "HTTP/1.1");
post.setRequestHeader ("Connection", "Keep-Alive");
xmlInBytes =new ByteArrayInputStream(xmlStr.getBytes());
post.setRequestBody(xmlInBytes);
if (xmlStr.length() < Integer.MAX_VALUE) {
post.setRequestContentLength(xmlStr.length());
}
else {
post.setRequestContentLength(EntityEnclosingMethod.CONTENT_LENGTH_CHUNKED);
}
// Execute request


toConsole("B4 sending xml, connMgr.getConnectionsInUse()="+connMgr.getConnectionsInUse());
toConsole(">>>>>>>> Send xml to somewhere @ "+ new java.sql.Timestamp(System.currentTimeMillis()));
int result = httpClient.executeMethod(post);
//System.out.println("Response body: ");
MQClientConstants.toConsole(">>>>>>>> Reply from fxlink received @ "+ new java.sql.Timestamp(System.currentTimeMillis()));
String xml = post.getResponseBodyAsString();
post.releaseConnection();


=================================

Httpclient was created like this :
==================================
connMgr = new MultiThreadedHttpConnectionManager();
connMgr.setMaxConnectionsPerHost( MAXHOSTCONNECTIONS );//20 connections
MQClientConstants.toConsole("MultiThreadedHttpConnectionManager setMaxConnectionsPerHost = "+MAXHOSTCONNECTIONS);


connMgr.setConnectionStaleCheckingEnabled( true );
MQClientConstants.toConsole("MultiThreadedHttpConnectionManager setConnectionStaleCheckingEnabled = "+true);
httpClient = new HttpClient(connMgr);
httpClient.setTimeout(TIMEOUT);//5 secs
httpClient.setStrictMode(true);
==================================


Paul

Ortwin Glück wrote:



paul wrote:

2004/05/26 20:09:50:290 SGT [DEBUG] EntityEnclosingMethod - -Request body sent
2004/05/26 20:09:50:562 SGT [DEBUG] HttpMethodBase - -Closing the connection.


Why is the connection closed here? Who is doing this? The response has not been read yet!

Could this be a threading issue? Are you reusing HttpMethod objects? At what point you call HttpMethod#releaseConnection()?

Any code from your app available?

2004/05/26 20:09:50:563 SGT [INFO] HttpMethodBase - -Recoverable exception caught when processing request
2004/05/26 20:09:50:563 SGT [WARN] HttpMethodBase - -Recoverable exception caught but MethodRetryHandler.retryMethod() returned false, rethrow
ing exception
2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager - -Freeing connection, hostConfig=HostConfiguration[host=somewhere.com, protocol=https:443, port=443]
2004/05/26 20:09:50:564 SGT [DEBUG] MultiThreadedHttpConnectionManager - -Notifying no-one, there are no waiting threads
org.apache.commons.httpclient.HttpRecoverableException: java.net.SocketException: Connection reset
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1965)






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to