commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Sutton <adrian.sut...@ephox.com>
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
at:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16864

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
www.ephox.com


-----Original Message-----
From: Eduardo Francos [mailto:efrancosos@incontext.fr]
Sent: Thursday, 6 February 2003 10:32 PM
To: commons-user@jakarta.apache.org
Subject: [HTTPClient] NullPointerException in continuation status line


Hi,

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:
http://www.pc.ibm.com/us/accessories/monitors/p_allmodelos.html

The "correct" url is
http://www.pc.ibm.com/us/accessories/monitors/p_allmodels.html

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 
exception.
>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.

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

java.lang.NullPointerException   at 
org.apache.commons.httpclient.HttpMethodBase.setResponseHeader(HttpMethodBas
e.java:2042)   at 
org.apache.commons.httpclient.HttpMethodBase.readResponseHeaders(HttpMethodB
ase.java:1752)   at 
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
a:1561)   at 
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
ava:2219)   at 
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:828
)   at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:574)
at 
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:493)
at ...



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


Mime
View raw message