Paul, The problem is obviously caused by the server's dropping connection right after HttpClient is done sending the request. If you have access to the target server, check the server logs to find out what prompted the server to do so.
I can think of two possibilities: (1) The server did not accept the request due to an authentication error (wrong credentials and stuff), immediately sent back 'unauthorized' response and dropped the connection while HttpClient was still busy sending the request body. If unsuccessful authentication is indeed the cause of the problem you can solve it by activating the '100-continue' handshake. See EntityEnclosingMethod javadocs for details (2) The server dropped the connection due to a very high load or any other reason preventing it from successfully processing the request. Server log file is your best friend in this case Hope this helps Oleg -----Original Message----- From: paul [mailto:[EMAIL PROTECTED] Sent: Thu 5/27/2004 14:25 To: Commons HttpClient Project Cc: Subject: Re: HttpClient problems Here's the wire log : ============================================================== 2004/05/26 20:09:50:262 SGT [DEBUG] MultiThreadedHttpConnectionManager - -HttpConnectionManager.getConnection: config = HostConfiguration[hos t=somewhere.com, protocol=https:443, port=443], timeout = 0 2004/05/26 20:09:50:262 SGT [DEBUG] MultiThreadedHttpConnectionManager - -Getting free connection, hostConfig=HostConfiguration[host=somewhere.com, protocol=https:443, port=443] 2004/05/26 20:09:50:263 SGT [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0) 2004/05/26 20:09:50:270 SGT [DEBUG] HttpMethodBase - -Execute loop try 1 2004/05/26 20:09:50:280 SGT [DEBUG] wire - ->> "POST /fxlweb/XMLGateway.asp HTTP/1.1[\r][\n]" 2004/05/26 20:09:50:281 SGT [DEBUG] HttpMethodBase - -Adding Host request header 2004/05/26 20:09:50:282 SGT [DEBUG] wire - ->> "Content-type: text/xml; charset=ISO-8859-1[\r][\n]" 2004/05/26 20:09:50:283 SGT [DEBUG] wire - ->> "Authorization: Basic someencrypteddata[\r][\n]" 2004/05/26 20:09:50:283 SGT [DEBUG] wire - ->> "HTTP-Version: HTTP/1.1[\r][\n]" 2004/05/26 20:09:50:284 SGT [DEBUG] wire - ->> "Connection: Keep-Alive[\r][\n]" 2004/05/26 20:09:50:285 SGT [DEBUG] wire - ->> "User-Agent: Jakarta Commons-HttpClient/2.0final[\r][\n]" 2004/05/26 20:09:50:286 SGT [DEBUG] wire - ->> "Host: somewhere.com[\r][\n]" 2004/05/26 20:09:50:287 SGT [DEBUG] wire - ->> "Cookie: $Version=0; ASPSESSIONIDAACRQATR=DKBJEFCAIKAHLGIMJKIBEGBH; $Path=/[\r][\n]" 2004/05/26 20:09:50:287 SGT [DEBUG] wire - ->> "Content-Length: 594[\r][\n]" 2004/05/26 20:09:50:288 SGT [DEBUG] wire - ->> "[\r][\n]" 2004/05/26 20:09:50:289 SGT [DEBUG] EntityEnclosingMethod - -Using unbuffered request body 2004/05/26 20:09:50:290 SGT [DEBUG] wire - ->> "<?xml version="1.0" encoding="UTF-8"?>xmldata here" 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. 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) at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:675) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529) ============================================================= Thanks a lot for the info. Ortwin Glück wrote: > > > paul wrote: > >> 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) >> >> at >> org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2659) >> > > > > >> Does anybody know what causes the SocketException ? > > > Not yet, but we're gonna find out for you :-) > > Please produce a wirelog and send the section with the request / > response immediately preceding the exception. > For instructions about how to make a wirelog please see our Logging > Guide: > http://jakarta.apache.org/commons/httpclient/logging.html > > Please note that wire logging will slow down your application > considerably! This is escpecially bad, because the problem you are > experiencing seems to happen randomly. Please make sure you disable > logging after you have successfully captured the output. > > >> Is it becos I didn't >> set a higher maximum connection per host using >> setMaxConnectionsPerHost on the MultiThreadedHttpConnectionManager >> object ? > > > Probably not - just doesn't look like it. > >> Pls help. This is urgent as I am currently using it on a production >> system. > > > You are welcome. Maybe we should start offering commercial support and > make A LOT of money :-) > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]