Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4-RC1
    • Component/s: None
    • Labels:
      None

      Description

      I'm getting a NullPointer from BasicResolver for a given set up which I've managed to simplify to an ivyconf.xml, two ivy.xml files and an ant build file. See attached zip file.

      When I run the ivy resolve task from the ant file, I get the following NPE:

      java.lang.NullPointerException
      at java.util.Calendar.setTime(Calendar.java:1032)
      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:785)
      at java.text.SimpleDateFormat.format(SimpleDateFormat.java:778)
      at java.text.DateFormat.format(DateFormat.java:314)
      at fr.jayasoft.ivy.resolver.BasicResolver.getDependency(BasicResolver.java:323)
      at fr.jayasoft.ivy.IvyNode.loadData(IvyNode.java:589)
      at fr.jayasoft.ivy.Ivy.fetchDependencies(Ivy.java:1023)
      at fr.jayasoft.ivy.Ivy.doFetchDependencies(Ivy.java:1085)
      at fr.jayasoft.ivy.Ivy.fetchDependencies(Ivy.java:1029)
      at fr.jayasoft.ivy.Ivy.getDependencies(Ivy.java:949)
      at fr.jayasoft.ivy.Ivy.resolve(Ivy.java:764)
      at fr.jayasoft.ivy.ant.IvyResolve.execute(IvyResolve.java:100)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at org.apache.tools.ant.Target.execute(Target.java:341)

        Activity

        Hide
        Xavier Hanin added a comment -

        I've added a junit test, fixed the bug and review code to avoid such problems

        Show
        Xavier Hanin added a comment - I've added a junit test, fixed the bug and review code to avoid such problems
        Hide
        Kenny MacLeod added a comment -

        Maarten, that did the job, thanks.

        Show
        Kenny MacLeod added a comment - Maarten, that did the job, thanks.
        Hide
        Maarten Coene added a comment -

        Xavier:
        I think this can be fixed by changing line 106 of IvyResolve.java to "getPubDate(_pubdate, new Date()),".
        However, I don't have time now to try to create junit test for this, so I cannot verify. None of the current junit tests are checking this very particular case.

        Kenny:
        I think it is caused because you don't specify a revision in the ivy.xml file of module2. Could you check if the problem still occurs after adding a revision to it?

        Show
        Maarten Coene added a comment - Xavier: I think this can be fixed by changing line 106 of IvyResolve.java to "getPubDate(_pubdate, new Date()),". However, I don't have time now to try to create junit test for this, so I cannot verify. None of the current junit tests are checking this very particular case. Kenny: I think it is caused because you don't specify a revision in the ivy.xml file of module2. Could you check if the problem still occurs after adding a revision to it?
        Hide
        Kenny MacLeod added a comment -

        The ant script assumes the ivy-1.3.1.jar to be in a "lib" sub directory.

        Show
        Kenny MacLeod added a comment - The ant script assumes the ivy-1.3.1.jar to be in a "lib" sub directory.

          People

          • Assignee:
            Xavier Hanin
            Reporter:
            Kenny MacLeod
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Due:
              Created:
              Updated:
              Resolved:

              Development