hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Intermittent ProtocolException in HttpClient 3.x
Date Thu, 24 Jul 2014 12:47:21 GMT
On Thu, 2014-07-24 at 12:32 +0000, Alex, Joseph (Contractor) wrote:
> Hi Oleg,
> 
> We will consider upgrading, but wanted to know if this issue is specific to HttpClient
(in which case, upgrade would help) or at the underlying transport level. The part that's
puzzling is the intermittent nature of this error. The posts I've seen so far mention about
misconfigured certificates etc. for which the error happens on every invocation. This is a
direct call from client to a single JVM instance specifying host:port (no proxies, load balancers
etc.) so the possibility of one of the hosts being misconfigured is also out of question.
> 

I doubt this issue is client related but there are reasons to upgrade to
HC 4.3.

Oleg

> Thanks,
> Joseph
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Thursday, July 24, 2014 6:39 AM
> To: HttpClient User Discussion
> Subject: Re: Intermittent ProtocolException in HttpClient 3.x
> 
> On Thu, 2014-07-24 at 03:38 +0000, Alex, Joseph (Contractor) wrote:
> > After enabling wire logging, we see that the response is having some hex values
([0x15][0x3][0x1][0x0][0x2][0x2]) at the beginning of response for all failed cases. This
explains the ProtocolException, since it's not starting with HTTP. Sample below :
> > 
> > org.apache.commons.httpclient.Wire.wire  >> "GET /api/request?id=111 HTTP/1.1[\r][\n]"
> > org.apache.commons.httpclient.Wire.wire  >> "Authorization: Basic AAA[\r][\n]"
> > org.apache.commons.httpclient.Wire.wire  >> "User-Agent: Jakarta Commons-HttpClient/3.0.1[\r][\n]"
> > org.apache.commons.httpclient.Wire.wire  >> "Host:a.b.com:8443[\r][\n]"
> > org.apache.commons.httpclient.Wire.wire  >> "[\r][\n]"
> > org.apache.commons.httpclient.Wire.wire  << "[0x15][0x3][0x1][0x0][0x2][0x2][\r][\n]"
> > org.apache.commons.httpclient.Wire.wire  << "null[\r][\n]"
> > 
> > Googling this pattern (15 03 01 00 02 02) , it seems to match with SSL handshake
errors (v3 alert, but with last byte missing..from http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4483157)
. What could be the reasons for such a response?
> > 
> > Thanks,
> > Joseph
> > 
> 
> Joseph,
> 
> I am very sorry but HC 3.1 is no longer supported. Please consider upgrading.
> 
> Oleg
> 
> > 
> > -----Original Message-----
> > From: Alex, Joseph (Contractor)
> > Sent: Saturday, July 19, 2014 1:42 AM
> > To: HttpClient User Discussion
> > Subject: Intermittent ProtocolException in HttpClient 3.x
> > 
> > Hi,
> > 
> > We are getting intermittent ProtocolException " failed to respond with a valid HTTP
response" when calling a https URL hosted in Tomcat 6.x. This is HTTPClient 3.x and used within
an IBM JVM (JDK 6.x) Both client and server are within same organization, just different servers
and configuration. Stacktrace below :
> > 
> > org.apache.commons.httpclient.ProtocolException: The server a.b.com failed to respond
with a valid HTTP response
> >         at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1846)
> >         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(HttpMethodDirector.java:397)
> >         at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170)
> >         at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
> >         at 
> > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java
> > :324)
> > 
> > From HTTPClient source, this is thrown here :
> > 
> > else if (s == null || count >= maxGarbageLines) {
> >                 // Giving up
> >                 throw new ProtocolException("The server " + conn.getHost() +
> >                         " failed to respond with a valid HTTP response");
> >             }
> > 
> > I assume this means a connection has been established ,and a response returned ,
but it's just not valid and at some point it becomes null. Is this a right assumption, and
how do we go about debugging. Is this related to the URL being HTTPS , and why does it happen
only intermittently. During these errors, we don’t see entries in the server's access log,
which indicates the request hasn't been processed.
> > 
> > Thanks,
> > Joseph
> > 
> > 
> > 
> > This message, including any attachments, is the property of Sears Holdings Corporation
and/or one of its subsidiaries. It is confidential and may contain proprietary or legally
privileged information. If you are not the intended recipient, please delete it without reading
the contents. Thank you.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> This message, including any attachments, is the property of Sears Holdings Corporation
and/or one of its subsidiaries. It is confidential and may contain proprietary or legally
privileged information. If you are not the intended recipient, please delete it without reading
the contents. Thank you.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message