hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex, Joseph (Contractor)" <Joseph.A...@searshc.com>
Subject Intermittent ProtocolException in HttpClient 3.x
Date Sat, 19 Jul 2014 06:41:55 GMT

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.


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.
View raw message