commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <>
Subject RE: [HTTPClient] NullPointerException in continuation status line
Date Fri, 07 Feb 2003 01:09:47 GMT
Hmm, that's a bug.  I've logged bug number 16864 about it which you can view

If you register for a bugzilla account (free in both the monetary and pain
sense) you can add yourself to the CC for the bug to be notified as the
developers add comments and fix it etc.

Hopefully it shouldn't be too hard for the knowledgeable developers on the
dev list to fix. :)

Thanks for the report.

Adrian Sutton, Software Engineer
Ephox Corporation

-----Original Message-----
From: Eduardo Francos []
Sent: Thursday, 6 February 2003 10:32 PM
Subject: [HTTPClient] NullPointerException in continuation status line


Configuration: HTTPClient 2.0 Alpha 2

I'm getting a NullPointerException instead of the expected 404 (the stack
trace is below) when I try to get 
the following url:

The "correct" url is

I traced the problem to HttpMethodBase.readResponseHeaders and found that
the response contains a header 
with value (note the space at the beginning) " The file does not exist or is
read-protected." *but with a 
null name*, so when calling setResponseHeader(header) the call
header.getName().toLowerCase() throws the 
>From a lower level trace I saw that the string about the file not existing
is part of a folded status line 
and not a separate header.
I applied a temporary fix in my sandbox to
HttpMethodBase.readResponseHeaders by checking the name for null 
and if so then just ignore the line and continue with the next header.
Normally this continuation line should be appended to the status line but I
don't know enough of the 
library to fix it myself.

This is the relevant part of the stack trace for the Exception:

java.lang.NullPointerException   at 
org.apache.commons.httpclient.HttpMethodBase.setResponseHeader(HttpMethodBas   at 
org.apache.commons.httpclient.HttpMethodBase.readResponseHeaders(HttpMethodB   at 
a:1561)   at 
ava:2219)   at 
)   at 
at ...

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message