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

NPE in Ivy:install task if the repository cache dir has been cleared

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-RC1
    • 2.0-RC1
    • Core
    • None

    Description

      In the latest version from trunk a NPE in the ivy:install task can occur if a file cannot be resolved.

      Stack trace:

      java.lang.NullPointerException
              at org.apache.ivy.ant.IvyInstall.doExecute(IvyInstall.java:109)
              at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
              at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
              at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
              at org.apache.tools.ant.Task.perform(Task.java:348)
              at org.apache.tools.ant.Target.execute(Target.java:357)
              at org.apache.tools.ant.Target.performTasks(Target.java:385)
              at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
              at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
              at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
              at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
              at org.apache.tools.ant.Main.runBuild(Main.java:698)
              at org.apache.tools.ant.Main.startAnt(Main.java:199)
              at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
              at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
      Caused by: java.lang.NullPointerException
              at org.apache.ivy.plugins.repository.sftp.SFTPRepository.put(SFTPRepository.java:144)
              at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
              at org.apache.ivy.plugins.resolver.RepositoryResolver.put(RepositoryResolver.java:214)
              at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:204)
              at org.apache.ivy.core.install.InstallEngine.install(InstallEngine.java:150)
              at org.apache.ivy.Ivy.install(Ivy.java:526)
              at org.apache.ivy.ant.IvyInstall.doExecute(IvyInstall.java:101)
              ... 17 more
      --- Nested Exception ---
      java.lang.NullPointerException
              at org.apache.ivy.plugins.repository.sftp.SFTPRepository.put(SFTPRepository.java:144)
              at org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
              at org.apache.ivy.plugins.resolver.RepositoryResolver.put(RepositoryResolver.java:214)
              at org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:204)
              at org.apache.ivy.core.install.InstallEngine.install(InstallEngine.java:150)
              at org.apache.ivy.Ivy.install(Ivy.java:526)
              at org.apache.ivy.ant.IvyInstall.doExecute(IvyInstall.java:101)
              at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
              at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
              at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
              at org.apache.tools.ant.Task.perform(Task.java:348)
              at org.apache.tools.ant.Target.execute(Target.java:357)
              at org.apache.tools.ant.Target.performTasks(Target.java:385)
              at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
              at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
              at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
              at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
              at org.apache.tools.ant.Main.runBuild(Main.java:698)
              at org.apache.tools.ant.Main.startAnt(Main.java:199)
              at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
              at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
      

      Complete output of ant-verbose (without stack trace:

      repository-copy:
      [ivy:install] :: installing org.junit#junit;3.8.1 ::
      [ivy:install] :: resolving dependencies ::
      [ivy:install] resolving dependencies for configuration 'default'
      [ivy:install] == resolving dependencies for apache#ivy-install;1.0 [default]
      [ivy:install] == resolving dependencies apache#ivy-install;1.0->org.junit#junit;3.8.1 [default->*]
      [ivy:install] integration.chained.resolver: Checking cache for: dependency: org.junit#junit;3.8.1 {default=[*]}
      [ivy:install]           tried D:\ws\eclipse-3.3.1\AAD\build\ivy-repository-copy/../../ivy-cache/integration/org.junit/junit/ivy-junit-3.8.1.xml
      [ivy:install]   integration: found md file for org.junit#junit;3.8.1
      [ivy:install]           => D:\ws\eclipse-3.3.1\AAD\build\ivy-repository-copy\..\..\ivy-cache\integration\org.junit\junit\ivy-junit-3.8.1.xml (3.8.1)
      [ivy:install]   [NOT REQUIRED] org.junit#junit;3.8.1!ivy.xml(ivy.original)
      [ivy:install]   found org.junit#junit;3.8.1 in integration
      [ivy:install] :: downloading artifacts to cache ::
      [ivy:install]   [NOT REQUIRED] org.junit#junit;3.8.1!junit.jar
      [ivy:install] :: installing in external-publish-repository ::
      [ivy:install] installing org.junit#junit;3.8.1
      [ivy:install] :: SSH :: connecting to 172.30.247.68...
      [ivy:install] :: SSH :: connected to 172.30.247.68!
      [ivy:install] :: SFTP :: connected to 172.30.247.68!
      [ivy:install]   published junit to IVY-repositories/01-IVY-external-repository/org.junit/junit/jars/junit-3.8.1.jar
      
      BUILD FAILED
      D:\ws\eclipse-3.3.1\AAD\build\ivy-repository-copy\build.xml:20: impossible to install org.junit#junit;3.8.1: java.lang.NullPointerException
      
      <<stack trace removed>>
      
      Total time: 5 seconds
      D:\ws\eclipse-3.3.1\AAD\build\ivy-repository-copy>
      

      Situation after producing the NPE: the jars are installed, the ivy file has not been installed.

      Attachments

        1. IVY-843.zip
          1.10 MB
          Erik-Berndt Scheper

        Activity

          People

            xavier Xavier Hanin
            fbascheper Erik-Berndt Scheper
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: