Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.

Hi Darin,

I tried separating the task class from the rest of the plugin and gave it its own jar. When I compile the task class I add the rest of my plugin to the classpath so that it can compile with references to classes in my plugin. I don't have any references in my plugin to the task jar and my plugin.xml makes no reference to it except for the ant task extension.

I tried running my task and it half-workd just as before. It will dump some output and as soon as it tries to instantiate on of my plugin classes, it produces the following stack trace in Eclipse 3.0M6:

[diagram] org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start()

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.startActivator(BundleContext.java:1071)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.start(BundleContext.java:991)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:403)

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.start(Bundle.java:312)

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.defineClass0(Native Method)

[diagram] at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader.findClassImpl(DefaultClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader.findClass(DefaultClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.findLocalClass(BundleClassLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.loadClass(Bundle.java(Compiled Code))

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation(PluginDescriptor.java:471)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:438)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:406)

[diagram] at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:48)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext$1.run(BundleContext.java:1054)

[diagram] at java.security.AccessController.doPrivileged1(Native Method)

[diagram] at java.security.AccessController.doPrivileged(AccessController.java:350)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.startActivator(BundleContext.java:1050)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.start(BundleContext.java:991)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:403)

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.start(Bundle.java:312)

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

[diagram] at com.ibm.xtools.exportjavadoc.internal.JavadocOperation.<init>(JavadocOperation.java:47)

[diagram] at ... CustomTask.execute(Unknown Source)

[diagram] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)

[diagram] at org.apache.tools.ant.Task.perform(Task.java:401)

[diagram] at org.apache.tools.ant.Target.execute(Target.java:338)

[diagram] at org.apache.tools.ant.Target.performTasks(Target.java:365)

[diagram] at org.apache.tools.ant.Project.executeTarget(Project.java:1237)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:661)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:438)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:84)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[diagram] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))

[diagram] at java.lang.reflect.Method.invoke(Method.java(Compiled Code))

[diagram] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:342)

[diagram] at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:225)

[diagram] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:157)

[diagram] at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:778)

[diagram] at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:628)

[diagram] at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:536)

[diagram] at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

[diagram] java.lang.ExceptionInInitializerError

[diagram] at some.plugin.somePlugin.<clinit>(somePlugin.java:49)

[diagram] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[diagram] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:79)

[diagram] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))

[diagram] at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation(PluginDescriptor.java:488)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:438)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:406)

[diagram] at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:48)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext$1.run(BundleContext.java:1054)

[diagram] at java.security.AccessController.doPrivileged1(Native Method)

[diagram] at java.security.AccessController.doPrivileged(AccessController.java:350)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.startActivator(BundleContext.java:1050)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.start(BundleContext.java:991)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:403)

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.start(Bundle.java:312)

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.defineClass0(Native Method)

[diagram] at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.defineClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader.findClassImpl(DefaultClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.defaultadaptor.DefaultClassLoader.findClass(DefaultClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.findLocalClass(BundleClassLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.loadClass(Bundle.java(Compiled Code))

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation(PluginDescriptor.java:471)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:438)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:406)

[diagram] at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:48)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext$1.run(BundleContext.java:1054)

[diagram] at java.security.AccessController.doPrivileged1(Native Method)

[diagram] at java.security.AccessController.doPrivileged(AccessController.java:350)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.startActivator(BundleContext.java:1050)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.start(BundleContext.java:991)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:403)

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.start(Bundle.java:312)

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

[diagram] at someplugin.someOperation.<init>(someOperation.java:47)

[diagram] at someplugin.CustomTask.execute(Unknown Source)

[diagram] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)

[diagram] at org.apache.tools.ant.Task.perform(Task.java:401)

[diagram] at org.apache.tools.ant.Target.execute(Target.java:338)

[diagram] at org.apache.tools.ant.Target.performTasks(Target.java:365)

[diagram] at org.apache.tools.ant.Project.executeTarget(Project.java:1237)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:661)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:438)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:84)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[diagram] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))

[diagram] at java.lang.reflect.Method.invoke(Method.java(Compiled Code))

[diagram] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:342)

[diagram] at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:225)

[diagram] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:157)

[diagram] at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:778)

[diagram] at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:628)

[diagram] at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:536)

[diagram] at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

[diagram] Caused by: org.eclipse.jface.util.Assert$AssertionFailedException: null argument;

[diagram] at org.eclipse.jface.util.Assert.isNotNull(Assert.java:139)

[diagram] at org.eclipse.jface.util.Assert.isNotNull(Assert.java:116)

[diagram] at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:66)

[diagram] at org.eclipse.jface.resource.ImageRegistry.<init>(ImageRegistry.java:58)

<Some custom plugin resource manager stuff here>

[diagram] org.osgi.framework.BundleException: Exception in org.eclipse.core.internal.compatibility.PluginActivator.start()

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.startActivator(BundleContext.java:1071)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.start(BundleContext.java:991)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:403)

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.start(Bundle.java:312)

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

[diagram] at someplugin.someOperation.<init>(someOperation.java:47)

[diagram] at someplugin.CustomTask.execute(Unknown Source)

[diagram] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)

[diagram] at org.apache.tools.ant.Task.perform(Task.java:401)

[diagram] at org.apache.tools.ant.Target.execute(Target.java:338)

[diagram] at org.apache.tools.ant.Target.performTasks(Target.java:365)

[diagram] at org.apache.tools.ant.Project.executeTarget(Project.java:1237)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:661)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:438)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:84)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[diagram] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))

[diagram] at java.lang.reflect.Method.invoke(Method.java(Compiled Code))

[diagram] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:342)

[diagram] at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:225)

[diagram] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:157)

[diagram] at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:778)

[diagram] at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:628)

[diagram] at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:536)

[diagram] at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

[diagram] java.lang.NoClassDefFoundError: com/ibm/xtools/common/ui/internal/plugin/XToolsUIPlugin

[diagram] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

[diagram] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:79)

[diagram] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java(Compiled Code))

[diagram] at java.lang.reflect.Constructor.newInstance(Constructor.java(Compiled Code))

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.internalDoPluginActivation(PluginDescriptor.java:488)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.doPluginActivation(PluginDescriptor.java:438)

[diagram] at org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin(PluginDescriptor.java:406)

[diagram] at org.eclipse.core.internal.compatibility.PluginActivator.start(PluginActivator.java:48)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext$1.run(BundleContext.java:1054)

[diagram] at java.security.AccessController.doPrivileged1(Native Method)

[diagram] at java.security.AccessController.doPrivileged(AccessController.java:350)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.startActivator(BundleContext.java:1050)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleContext.start(BundleContext.java:991)

[diagram] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:403)

[diagram] at org.eclipse.osgi.framework.internal.core.Bundle.start(Bundle.java:312)

[diagram] at org.eclipse.core.runtime.adaptor.EclipseClassLoader.findLocalClass(EclipseClassLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.requireClass(BundleLoader.java(Inlined Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findRequiredClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java(Compiled Code))

[diagram] at org.eclipse.osgi.framework.adaptor.BundleClassLoader.loadClass(BundleClassLoader.java(Compiled Code))

[diagram] at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))

[diagram] at someplugin.someOperation.<init>(someOperation.java:47)

[diagram] at someplugin.CustomTask.execute(Unknown Source)

[diagram] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)

[diagram] at org.apache.tools.ant.Task.perform(Task.java:401)

[diagram] at org.apache.tools.ant.Target.execute(Target.java:338)

[diagram] at org.apache.tools.ant.Target.performTasks(Target.java:365)

[diagram] at org.apache.tools.ant.Project.executeTarget(Project.java:1237)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:661)

[diagram] at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:438)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:84)

[diagram] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

[diagram] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))

[diagram] at java.lang.reflect.Method.invoke(Method.java(Compiled Code))

[diagram] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:342)

[diagram] at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:225)

[diagram] at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:157)

[diagram] at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:778)

[diagram] at org.eclipse.debug.ui.DebugUITools.buildAndLaunch(DebugUITools.java:628)

[diagram] at org.eclipse.debug.ui.DebugUITools$2.run(DebugUITools.java:536)

[diagram] at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:101)

BUILD FAILED: java.lang.NullPointerException


I'm kinda baffled here. It's like the plugin class loader is failing for some reason. I'm not sure if this is because of the classloader in Eclipse 3.0M6 or if its because of what I'm trying to do. I know that other people on my team have seen some classloader problems in the new eclipse 3.0M7.

Thanks again for the help,

Chris


Thursday, February 19, 2004 4:35 PM
To: platform-ant-dev@xxxxxxxxxxx
cc:
From: Darin Swanson <Darin_Swanson@xxxxxxxxxx>
Subject: Re: [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.



You are asking for all kinds of trouble bundling your task with the runtime JAR of your plugin. This will not work.
See the important rules section of
http://help.eclipse.org/help21/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ant_contributing_task.htm

Currently your task is getting loaded by the plugin classloader. All of the Ant classes are getting loaded by the AntClassLoader.
This leads to strange NPEs and "instance of" checks failing.
They way we achieve this is to have a separate source folder and output location for the JARs we bundle to add to the Ant runtime classpath and ensure these are not in the JARs generated for our plugin.

HTH
Darins



Chris McGee <cbmcgee@xxxxxxxxxx>
Sent by: platform-ant-dev-admin@xxxxxxxxxxx

02/19/04 01:16 PM
Please respond to platform-ant-dev

       
        To:        platform-ant-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.



Thanks for the info.

I managed to get the task to work fairly well as a member of my plugin as you suggested. For the library, I just set the xml attribute to "" and it seems to pick up the class from the jar for the plugin.

I must be running into some problems with eclipse 3.0 M6 and its classloader. There are some classes that I can access beyond my plugin, there are others that I can access beyond my plugin if I run the ant script twice (very strange) and there are still others that I cannot execute without exceptions being generated in the OSGi plugin loading code.

Thanks for the clarifications,

Chris

Thursday, February 19, 2004 4:11 PM
To: platform-ant-dev@xxxxxxxxxxx
cc:
From: Darin Swanson <Darin_Swanson@xxxxxxxxxx>
Subject: Re: [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.



I must have mislead you.
You get all the classloader "magic" for free by using the extension point and setting the correct requirements for your plugin in the plugin.xml.

You should be able to reference any class from your Ant task if that class is within the requirements chain for your plugin.

The classloader for that class will be the plugin classloader.

Using that classloader you can access the resource you need.


To get around using the bin directory as the library attribute value, we make use of the external tool builder support to automatically generate our JARs whenever we modify the source for the component classes of the JARs.


I hope I have made things clearer...

Darins



Chris McGee <cbmcgee@xxxxxxxxxx>
Sent by: platform-ant-dev-admin@xxxxxxxxxxx

02/19/04 11:50 AM
Please respond to platform-ant-dev

       
       To:        platform-ant-dev@xxxxxxxxxxx

       cc:        

       Subject:        Re: [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.




Hi Darins,

Thanks for the response.

I've defined my task using the extension point. What should I specify as the library tag that would normally be pointing to a JAR with my task? Right now, I've tried just specifying the "bin" directory and it seems to work alright until we decide to package this stuff. The ClassLoaders seem to be very fragile and will load certain classes just fine but throw NPE's on others.

How does one get access to the AntClassLoader? I'm assuming that I could get the Class for the task I've defined, and ask the class for its classloader, which would be the one used in ant. After that, how can you set the classloader's parent?

Chris



Thursday, February 19, 2004 2:25 PM
To: platform-ant-dev@xxxxxxxxxxx
cc:
From: Darin Swanson <Darin_Swanson@xxxxxxxxxx>
Subject: Re: [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.



If the dependancies are set up correctly for the plugin you are providing the task from.

Using the Eclipse extension point for defining tasks, the plugin classloader for the plugin contributing the task is added as a parent classloader of the AntClassLoader that is used during the build.


Then you could get a class from the other plugin, get its classloader and ask that classloader to load the resource.
I have not tried it but it should work...famous last words :-)


HTH

Darins


Chris McGee <cbmcgee@xxxxxxxxxx>
Sent by: platform-ant-dev-admin@xxxxxxxxxxx

02/19/04 10:52 AM
Please respond to platform-ant-dev

       
      To:        platform-ant-dev@xxxxxxxxxxx

      cc:        

      Subject:        [platform-ant-dev] Using other eclipse plugin resources from contributed ant task.









Hi All,

Sorry if this question has an obvious answer. I'm just starting to learn
about Ant and its integration into Eclipse 3.

Is it possible to define an Ant task in one of my plugins so that it may
access the other plugins that the plugin has dependencies? I'm able to get
an Ant task to work by creating a separate Jar that is not loaded as part
of my plugin but I would like ant task to have access to all of the
resources available from the other plugins.

Thanks,

Chris McGee
IBM
Ottawa, Canada

_______________________________________________
platform-ant-dev mailing list
platform-ant-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ant-dev






Back to the top