Hi guys, my name is Petar Tahchiev and I am one of the developers of Jakarta Cactus. I have a really strange problem, when using Ant > 1.6.5. When trying to execute my cactus tasks, I invoke actually the JunitTask, I get the following exception: ----------------------------------------------------------------------------- /home/peter/bin/workspace/TestCactus/build.xml:93: java.lang.NullPointerException at org.apache.tools.ant.dispatch.DispatchUtils.execute( DispatchUtils.java:115) 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:758) at org.apache.tools.ant.Main.startAnt(Main.java:217) 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.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM( JUnitTask.java:1272) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute( JUnitTask.java:823) at org.apache.cactus.integration.ant.CactusTask.executeInContainer( CactusTask.java:453) at org.apache.cactus.integration.ant.CactusTask.execute( CactusTask.java:204) 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) ... 11 more --- Nested Exception --- java.lang.NullPointerException at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM( JUnitTask.java:1272) at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute( JUnitTask.java:823) at org.apache.cactus.integration.ant.CactusTask.executeInContainer( CactusTask.java:453) at org.apache.cactus.integration.ant.CactusTask.execute( CactusTask.java:204) 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:758) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Total time: 8 seconds ------------------------------------------------------------------------------------------------ However, if I downgrade to Ant 1.6.5 I don't get this exception and everything passes smoothly. Looking at the source code of the task, on line 1272 here is what we see: runner = delegate.newJUnitTestRunner(test, test.getHaltonerror(), test.getFiltertrace(), test.getHaltonfailure(), false, true, classLoader); so it turns out that delegate is null !!! In Ant 1.6.5. there seems that this "delegate" object is missing. Also when we look on line 799 we see that delegate is explicitly nullified: ------------------------------------------------ delegate = null; ------------------------------------------------ ???? Does these thoughts make any sense, and if yes, how can I resolve my problems. Thank you. -- Regards, Petar! Karlovo, Bulgaria. EOOXML Objections http://www.grokdoc.net/index.php/EOOXML_objections Public PGP Key at: https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611 Key Fingerprint: A369 A7EE 61BC 93A3 CDFF 55A5 1965 8550 C311 0611