Ivy
  1. Ivy
  2. IVY-1400

NullPointerException - problem while listing resources

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0-RC1
    • Component/s: None
    • Labels:
      None

      Description

      After debugging, the problem appears when using org.apache.ivy.util.url.HttpClientHandler (connecting jakarta commons http client).

      A check is missing in getURLInfo() when web server does not return content-type in HTTP header. Line 156, method.getResponseHeader("content-type") returns null so NPE occurs when calling getValue().

      Works fine with BasicURLHandler.

      Should be something like:

      public URLInfo getURLInfo(URL url, int timeout) {
      ...
      if (checkStatusCode(url, method)) {
      HttpResponseHeader h = method.getResponseHeader("content-type");
      String contentType = h == null ? null : h.getValue();

      String bodyCharset = BasicURLHandler.getCharSetFromContentType(contentType);
      ...

        Issue Links

          Activity

          Hide
          Frédéric RIVIERE added a comment -

          Works fine. Do you think there is a chance to have a 2.3.1 official maintenance release ? Or should I wait for 2.4.0 ?

          Show
          Frédéric RIVIERE added a comment - Works fine. Do you think there is a chance to have a 2.3.1 official maintenance release ? Or should I wait for 2.4.0 ?
          Hide
          Maarten Coene added a comment -

          Thanks! You can find snapshot builds here:
          https://builds.apache.org/view/A-F/view/Ant/job/Ivy/

          Show
          Maarten Coene added a comment - Thanks! You can find snapshot builds here: https://builds.apache.org/view/A-F/view/Ant/job/Ivy/
          Hide
          Frédéric RIVIERE added a comment -

          I would be happy to give a try if you send me a link to a build snapshot.

          Show
          Frédéric RIVIERE added a comment - I would be happy to give a try if you send me a link to a build snapshot.
          Hide
          Maarten Coene added a comment -

          Thanks for the report!
          I've committed a fix in SVN trunk. Could you give it a try?

          Show
          Maarten Coene added a comment - Thanks for the report! I've committed a fix in SVN trunk. Could you give it a try?

            People

            • Assignee:
              Maarten Coene
              Reporter:
              Frédéric RIVIERE
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development