hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Pedro López Sáez <j...@altiria.com>
Subject Re: unable to find line starting with "HTTP"
Date Thu, 03 Jun 2004 08:45:45 GMT
Thank you for your responses.

Actually, I can't do anything in the server side because it's managed by
an external service provider. I don't know what server are they running
but I'll try to find it. 

I thought the problem was in the client side, but now I think I'll try
to ask them to solve the problem. Retrying the requests could be a
problem if the server really receives and processes them.  

I'll tell you about this issue when I know new matters.

	Juan Pedro López

> I am seeing this exact same problem with 2.0rc1 as well.  A wget to the 
> server from the same client works fine.  The httpclient wire log shows 
> that I get a redirect and then the in waiting for the HTTP status line 
> from the redirect, it never comes...
> 
> What server are you running?
> 
> -Eric
> 
> 
> Kalnichevski, Oleg wrote:
> 
> > 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. 
> > 
> > (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 <strong>BIG</strong>
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ópez Sáez [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". 
> > 
> > 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= new HttpClient();
> > client.setStrictMode(true);
> > client.setTimeout(120000); 
> > client.setConnectionTimeout(10000); 
> > 
> > PostMethod post = new PostMethod(currentURL);
> > post.setRequestContentLength(XMLRequest.length());
> > post.setRequestBody(XMLRequest);
> > post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
> > post.addRequestHeader("Connection", "close");
> > 
> > String response;
> > 
> > try{
> > httpStatus = client.executeMethod(post);
> > response = post.getResponseBodyAsString();
> > }
> > catch (HttpException e) {
> > log.fatal("IOException in client.executeMethod( post )",e);
> > throw e;
> > }
> > catch(IOException e){ 
> > 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.  
> > 
> > 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(HttpMethodBase.java:2659)
> > at
> > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1093)
> > at
> > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:674)
> > at
> > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:529)
> > 
> > I would apreciate any help.
> > 
> > Thank you very much
> > 
> > Juan Pedro López
> > 
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
-- 
Juan Pedro López Sáez
ALTIRIA TIC, Soluciones en Servicios Móviles
Tlf: 913 311 198
Móvil: 610 258 837
www.altiria.com


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Mime
View raw message