Uploaded image for project: 'Ivy'
  1. Ivy
  2. IVY-1499

NullPointerException while Retrieve

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.4.0-RC1
    • None
    • Core
    • Hard to say:
      Worked on my System: Win 7 64, Java 6u45, Eclipse Luna and Kepler with current Plugins (Ant, Ant Ivy, IvyDE, Ant Ivy Tasker)
      Occured on a very similar system and on my Test System with Lubuntu 14.04 64, OpenJDK 1.7.0_65

    Description

      I encountered a NullPointerException while retrieving an ivy file. Unfortunately I'm not able to recreate it properly.

      Stacktrace

      BUILD FAILED
      /var/lib/jenkins/jobs/antivy/workspace/dev/all.xml:12: The following error occurred while executing this line:
      /var/lib/jenkins/jobs/antivy/workspace/dev/common_module_build.xml:74: impossible to ivy retrieve: java.lang.RuntimeException: problem during retrieve of org.example#org.example.converter: java.lang.NullPointerException
      at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:249)
      at org.apache.ivy.Ivy.retrieve(Ivy.java:561)
      at org.apache.ivy.ant.IvyRetrieve.doExecute(IvyRetrieve.java:98)
      at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:271)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:622)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:435)
      at org.apache.tools.ant.Target.performTasks(Target.java:456)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
      at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
      at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:306)
      at org.apache.tools.ant.taskdefs.SubAnt.execute(SubAnt.java:221)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:622)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:435)
      at org.apache.tools.ant.Target.performTasks(Target.java:456)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
      at org.apache.tools.ant.Main.runBuild(Main.java:851)
      at org.apache.tools.ant.Main.startAnt(Main.java:235)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
      Caused by: java.lang.NullPointerException
      at org.apache.ivy.core.IvyPatternHelper.substituteTokens(IvyPatternHelper.java:239)
      at org.apache.ivy.core.IvyPatternHelper.substitute(IvyPatternHelper.java:171)
      at org.apache.ivy.core.retrieve.RetrieveEngine.determineArtifactsToCopy(RetrieveEngine.java:355)
      at org.apache.ivy.core.retrieve.RetrieveEngine.retrieve(RetrieveEngine.java:118)
      ... 34 more

      The converter (which is the project I try to build) depends on the core, which is also one of our projects. Since we only need the core for its dependencies, only the ivy.xml is published in my local repository and needed by the converter.

      I tried to figure out, what the problem is. It seems, ivy is unable to determine the destPattern (RetrieveEngine.java:355) while retrieving the core. While debugging, I noticed the type of the artifact is ivy, while destIvyPattern is null. This leads to destPattern being null, too.

      This could be a misconfiguration of any (ivy)pattern in the local repository, I'm sorry, I can not give you more information, but my configuration files are already changed, so I can not recreate the bug anymore. I would suggest to check the destPattern variable for null, so at least a proper Exception (instead of NullPointerException) can be thrown.

      I have no clue, why the problem occured on my linux system and the windows/eclipse configuration off my colleague, while it worked properly on mine.

      For debugging I checked out the current master branch (target.ivy.version=2.5.0), so the problem still exists there.

      Attachments

        Issue Links

          Activity

            People

              maartenc Maarten Coene
              Obererpel Marc Meier
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified