Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1506

groovy task in ant throws NPE when calling target from inside groovy with antcall

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.0-RC-1
    • Ant integration
    • None

    Description

      Please see the attached build.xml. I am using groovy from svn main trunk rev. 4066, which is installed in ./lib
      The output is:
      Buildfile: build.xml

      main:

      sub:
      [echo] Hello
      [echo] in groovy

      BUILD FAILED
      : java.lang.NullPointerException

      Total time: 7 seconds

      starting with ant -d I get the following stack trace:
      : java.lang.NullPointerException
      at org.apache.tools.ant.Task.perform(Task.java:373)
      at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:178)
      at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:175)
      at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:139)
      at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:86)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:164)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80)
      at Script1.run(Script1.groovy:2)
      at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:369)
      at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:259)
      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)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.Main.runBuild(Main.java:668)
      at org.apache.tools.ant.Main.startAnt(Main.java:187)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      Caused by: java.lang.NullPointerException
      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:321)
      at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      ... 22 more
      — Nested Exception —
      java.lang.NullPointerException
      at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:321)
      at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
      at org.apache.tools.ant.Task.perform(Task.java:364)
      at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:178)
      at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:175)
      at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:139)
      at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:86)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:164)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
      at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:80)
      at Script1.run(Script1.groovy:2)
      at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:369)
      at org.codehaus.groovy.ant.Groovy.execute(Groovy.java:259)
      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)
      at org.apache.tools.ant.Target.performTasks(Target.java:369)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      at org.apache.tools.ant.Main.runBuild(Main.java:668)
      at org.apache.tools.ant.Main.startAnt(Main.java:187)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

      Total time: 8 seconds

      Attachments

        1. build.xml
          0.6 kB
          Andreas Sahlbach
        2. antcall-from-groovy-task.patch
          2 kB
          Andreas Sahlbach

        Activity

          People

            guillaume Guillaume Sauthier
            ace Andreas Sahlbach
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: