Return-Path: Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@www.apache.org Received: (qmail 17183 invoked from network); 2 Jun 2004 17:53:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Jun 2004 17:53:01 -0000 Received: (qmail 25584 invoked by uid 500); 2 Jun 2004 17:53:09 -0000 Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@jakarta.apache.org Received: (qmail 25470 invoked by uid 500); 2 Jun 2004 17:53:08 -0000 Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Commons HttpClient Project" Reply-To: "Commons HttpClient Project" Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 25447 invoked by uid 99); 2 Jun 2004 17:53:07 -0000 Received: from [57.80.136.22] (HELO kccxoex16.corp.kpmgconsulting.com) (57.80.136.22) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 02 Jun 2004 10:53:07 -0700 Received: from kccxoex06.corp.kpmgconsulting.com ([10.98.3.31]) by kccxoex16.corp.kpmgconsulting.com with InterScan Messaging Security Suite; Wed, 02 Jun 2004 17:52:43 -0000 x-mimeole: Produced By Microsoft Exchange V6.0.6487.1 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Subject: RE: unable to find line starting with "HTTP" Date: Wed, 2 Jun 2004 18:52:45 +0100 Message-ID: <825BF35A92B3F0479CC164ECBBE9376EE3B6B6@kccxoex06.corp.kpmgconsulting.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: unable to find line starting with "HTTP" Thread-Index: AcRItc290fyNoC9qSpauFF1HZ0T8QgAEIBaA From: "Kalnichevski, Oleg" To: "Commons HttpClient Project" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Juan, Usually HttpClient reports 'unable to find line starting with "HTTP"' = when the target server drops the connection without returning any = response. This can happen, for instance, if the server is being under = heavy load.=20 (1) If you have access to the target server, examine the server logs to = see why the connection was dropped. Fixing the problem on the server = side would be the best (2) Another possible solution to this problem _may_ be to retry the = request, provided that the POST methods your code is supposed to execute = are idempotent. If the server application, however, has been designed in = a way that it may receive a request, parse it, change the application = state (by committing some data to the data store, for instance) and then = simply drop the connection without giving any kind of response back to = the client, you are in BIG trouble, as simply retrying = the same POST method case cause data inconsistency problems. So, the = best thing to do is to get in touch with the server guys and find out if = it is safe to retry POST methods. Hope this clarifies things a little Oleg -----Original Message----- From: Juan Pedro L=F3pez S=E1ez [mailto:jpls@altiria.com] Sent: Wednesday, June 02, 2004 17:18 To: commons-httpclient-dev@jakarta.apache.org Subject: unable to find line starting with "HTTP" Hi, I've been searching in the archive list looking for something related to my "unable to find line starting with HTTP".=20 There are lots of comments about it, but they all seem to be unuseful for me. Currently I'm using 2.0-rc3 version. My HTTP client is very simple. Below you can see everything I do. That code is executed everytime I need to send new data to the HTTP server. -------------------------------------- HttpClient client=3D new HttpClient(); client.setStrictMode(true); client.setTimeout(120000);=20 client.setConnectionTimeout(10000);=20 PostMethod post =3D new PostMethod(currentURL); post.setRequestContentLength(XMLRequest.length()); post.setRequestBody(XMLRequest); post.setRequestHeader("Content-type", "text/xml; charset=3DISO-8859-1"); post.addRequestHeader("Connection", "close"); String response; try{ httpStatus =3D client.executeMethod(post); response =3D post.getResponseBodyAsString(); } catch (HttpException e) { log.fatal("IOException in client.executeMethod( post )",e); throw e; } catch(IOException e){=20 log.fatal("IOException in client.executeMethod( post )",e); throw e; } finally { post.releaseConnection(); } ------------------------------------------------ I'm getting the exception in the HttpClient.excetuteMethod line. The exception happens from time to time, is not quite common but I don't know what to do with it. =20 The exception stack trace is the following: org.apache.commons.httpclient.HttpRecoverableException: org.apache.commons.httpclient.HttpRecoverableException: Error in parsing the status line from the response: unable to find line starting with "HTTP" at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.= java:1965) at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBas= e.java:2659) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:= 1093) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:67= 4) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:52= 9) I would apreciate any help. Thank you very much Juan Pedro L=F3pez --------------------------------------------------------------------- To unsubscribe, e-mail: = commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: = commons-httpclient-dev-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org