You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/10/06 08:31:53 UTC

DO NOT REPLY [Bug 13342] New: - NullPointerException in HttpMethodBase.getResponseBodyAsString

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13342>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

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

NullPointerException in HttpMethodBase.getResponseBodyAsString

           Summary: NullPointerException in
                    HttpMethodBase.getResponseBodyAsString
           Product: Commons
           Version: 2.0 Alpha 1
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: HttpClient
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: ivelin@iname.com


The following code in a cocoon component, causes the NPE.
A delay seems to help sometimes.

-------------
      int htcode = httpClient.executeMethod( method );
       
      // @todo: fix-me
      // This sleep() is a temporary workaround 
      // to avoid NullPointerException in the next line.
      Thread.currentThread().sleep( 100 ); 

      String ret = method.getResponseBodyAsString();
---------------------

java.lang.NullPointerException 
at java.lang.String.<init>(String.java:399) 
at org.apache.commons.httpclient.HttpMethodBase.getResponseBodyAsString
(HttpMethodBase.java:579) 
at org.apache.cocoon.generation.WebServiceProxyGenerator.fetch
(WebServiceProxyGenerator.java:264)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>