Community
Participate
Working Groups
When using "-listener org.apache.tools.ant.XmlLogger". [exec] java.lang.reflect.InvocationTargetException: java.lang.NullPointerException [exec] at org.apache.tools.ant.XmlLogger.buildFinished (XmlLogger.java:119) [exec] at org.eclipse.ant.internal.core.ant.InternalAntRunner.fireBuildFinished (InternalAntRunner.java:507) [exec] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:305) [exec] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:443) [exec] at java.lang.reflect.Method.invoke(Native Method) [exec] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:338) [exec] at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:775) [exec] at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) [exec] at java.lang.reflect.Method.invoke(Native Method) [exec] at org.eclipse.core.launcher.Main.basicRun(Main.java:247) [exec] at org.eclipse.core.launcher.Main.run(Main.java:703) [exec] at org.eclipse.core.launcher.Main.main(Main.java:539)
On the current stream (which will be coming to light in the next weeks integration build and is available in the nightly builds), I fixed the problem with a reordering of when buildStarted(BuildEvent) was called and where the log.xml file was generated.
Please verify (Jared)
With the nightly build N22020924 I get another NPE. [exec] Using Y:\rnd_beehive_source_eclipse_vob\build\internal\estudio\logxyz.xml file as build log. [exec] java.lang.reflect.InvocationTargetException: java.lang.NullPointerException [exec] at org.apache.tools.ant.XmlLogger.messageLogged(XmlLogger.java:237) [exec] at org.apache.tools.ant.Project.fireMessageLoggedEvent (Project.java:982) [exec] at org.apache.tools.ant.Project.fireMessageLogged(Project.java:988) [exec] at org.apache.tools.ant.Project.log(Project.java:246) [exec] at org.apache.tools.ant.Project.setProperty(Project.java:269) [exec] at org.eclipse.ant.internal.core.ant.InternalAntRunner.fireBuildFinished (InternalAntRunner.java:573) [exec] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:496) [exec] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:421) [exec] at java.lang.reflect.Method.invoke(Native Method) [exec] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356) [exec] at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:775) [exec] at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) [exec] at java.lang.reflect.Method.invoke(Native Method) [exec] at org.eclipse.core.launcher.Main.basicRun(Main.java:247) [exec] at org.eclipse.core.launcher.Main.run(Main.java:703) [exec] at org.eclipse.core.launcher.Main.main(Main.java:539)
I believe another bug was causing this. The InternalAntRunner was always calling buildFinished even in cases where it had not called build started. I believe this made it into the 20020926 nightly build. Gunnar can you please give me the exact steps that were causing the NPE so I can ensure that all are fixed this time.
nothing special I just ran the following target in my build.xml <!-- executes the eclipse ant from within eclipse (should work on any os) --> <target name="eclipse.ant" if="eclipse.ant.buildfile.verified"> <exec executable="${temp.eclipse}/eclipse" dir="${eclipse.ant.dir}" failonerror="true"> <arg line="-nosplash -data ${temp.eclipse}/buildworkspace -application org.eclipse.ant.core.antRunner -listener org.apache.tools.ant.XmlLogger - logfile somelog.xml -Dinstall.path=${temp.estudio} - Dplugin.path=file:${temp.estudio}/plugins/,file:${temp.eclipse}/plugins/ - Dos=${os} -Dws=${ws} -Darch=${arch} -buildfile ${eclipse.ant.buildfile} ${eclipse.ant.target}"/> </exec> </target>
It seems that the build file never get executed. The fireBuildFinished() is called before the build is finished ?!? With N20020927 the NPE is still there but with a slightly different stack trace. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.ant.core.AntRunner.run(AntRunner.java:355) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:775) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) Caused by: java.lang.NullPointerException at org.apache.tools.ant.XmlLogger.messageLogged(XmlLogger.java:237) at org.apache.tools.ant.Project.fireMessageLoggedEvent(Project.java:982) at org.apache.tools.ant.Project.fireMessageLogged(Project.java:988) at org.apache.tools.ant.Project.log(Project.java:246) at org.apache.tools.ant.Project.setProperty(Project.java:269) at org.eclipse.ant.internal.core.ant.InternalAntRunner.fireBuildFinished (InternalAntRunner.java:587) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:511) at org.eclipse.ant.internal.core.ant.InternalAntRunner.run (InternalAntRunner.java:425) ... 14 more
the error also pops up if I start the ant runner with an invalid build file.
I can reproduce the problem...thanks Gunnar. Working on a solution.
Eclipse Ant as an IPlatformRunnable application had not been tested much on the new code base(sorry, different entry point into the code). Fixed the handling of command line arguments, non-existant build file and error reporting after the build was finished. Gunnar if you get the chance could you verify?
Reopening to reassign as must be verified for M2
Please verify (Luc)
Marking as fixed.
Verified. Please update the build notes (darinS)