Community
Participate
Working Groups
When I contribute the task defined in bug 34442 as an extension in a plug-in, the task generates an NPE when referenced at runtime. For some reason, it's "proejct" field is null. However, when I add the task (the same class) manually via the preferences, there is no NPE. I will attach the plug-in
Created attachment 3965 [details] zip of plugin The plug-in defines one task via the org.eclipse.ant.core.antTasks extension point.
At runimte, I get this output: Buildfile: D:\testspaces\test-space\Car\date.xml main: [date] Error in class Date [date] BUILD FAILED: file:D:/testspaces/test-space/Car/date.xml:3: java.lang.NullPointerException Total time: 52 seconds The build file is: <project name="Task development" default="main"> <target name="main"> <date></date> </target> </project>
I have moved up to RC2 and am seeing the same behaviour with our plugin's Ant tasks which extend via an extension point. project is null
Eric, is this a regression within RC2, that is, it worked in previous builds of Eclipse?
Yes, this is a regression. I just verified by reloading RC1 and our plugins. They work fine there. Eric VN
Thanks. Can you try one more thing if you have the time? Can you try RC2 with Ant 1.5.1 set as Ant home (note you will need to remove the Xerces JARs from the Ant home install)? No problem if you can't we will be looking into this more very soon.
This is a readme item. The root of the problem is that the custom task is getting loaded via the plugin classloader instead of the Ant classloader. From the work / changes on the Ant classloader required for: bug 33664 and bug 33117 it has made more restrictive for developing using tasks defined via the extension points. Key points: when self hosting you have two options -add the org.eclipse.ant.core plugin as source to your workspace and add your custom task prefix to the list of prefixes defined in the static initializer. This will disallow the plugin classloader parents from loading the task. -do not have task class on the build path for the plugin For generating your plugin, you must ensure that the class file for the custom Ant task is not included in the plugin library. Eric can you verify that this is your case?
*** Bug 35106 has been marked as a duplicate of this bug. ***
The easiest work around for me, was to make sure that my build file didn't include any of my ant task classes in my plugin's main jar file. This was easier then creating yet another project, just for the ant classes.
*** Bug 35153 has been marked as a duplicate of this bug. ***
Removing RC4, as this is will be a known limitation - no fix planned for 2.1
Added to the Eclipse readme for 2.1 in the known issues section for Ant.
*** Bug 49647 has been marked as a duplicate of this bug. ***
*** Bug 62623 has been marked as a duplicate of this bug. ***
*** Bug 105063 has been marked as a duplicate of this bug. ***