Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-113

NullPointerException in HttpMethodBase.getResponseBodyAsString

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0 Alpha 1
    • 2.0 Beta 1
    • HttpClient (classic)
    • None
    • Operating System: All
      Platform: Other
    • 13342

    Description

      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)

      Attachments

        Activity

          People

            olegk Oleg Kalnichevski
            ivelin@iname.com Ivelin Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: