Skip to main content



      Home
Home » Newcomers » Newcomers » Issue using AntRunner inside a plugin
Issue using AntRunner inside a plugin [message #272406] Wed, 22 July 2009 09:45 Go to next message
Eclipse UserFriend
I am trying to use the AntRunner class in org.eclipse.ant.core to run a
build script from within a plugin. The function this is in is called from
the "start" function of the plugin activator. The code is as follows:

try{
antRun.setBuildFileLocation(installTarget);
antRun.setArguments(arg);
antRun.run();
}catch(Exception e){e.printStackTrace();
throw new Exception("Install Failed");}

(antRun was declared as a new AntRunner previous to this code)

I have added org.eclipse.ant as a dependency for the plugin this is in.

The problem I am having is that when I package/export the plugin and try
to test it, I get a classnotfound style exception on AntRunner - however I
am using classes from two other plugins in the activator and elsewhere
without problem. I have tried packaging the class I am using AntRunner in
into its own jar and using the extraClassPathEntries extension point to
add it to the ant classpath without any change. The other plugins I am
using classes from are those that are dependencies of the plugin when the
project if first created - ant is the first one I tried to add. I did
follow the steps to export (Organize manifest, externalize strings, check
build cnfiguration, and then export), so I don' think th eproblem is there.

So what I want to know is what step in using AntRunner within an eclipse
plugin am I missing?

Thanks for any help
Re: Issue using AntRunner inside a plugin - More Information [message #272430 is a reply to message #272406] Thu, 23 July 2009 13:56 Go to previous message
Eclipse UserFriend
A little more clarification: I have tried to use the import packages
feature as well, and I have tried manually adding "org.eclipse.ant.core"
to the "uses" section of the Manifest file for the package which the class
using AntRunner is in. I have also looked at the dependencies that were
part of the default plug-in project (and are working) and can see no
differences in how they are setup compared to the dependency on
org.eclipse.ant.core. I am using a new eclipse environment (Ganymede)
which is updated, and no other plugins have been installed (Its the Java
dev version). I have verified that org.eclipse.ant.core is one of the
installed plugins. I cannot modify org.eclipse.ant.core, so Buddy
classloading wouldn't work - and when I tried to add an entry to use the
"global" policy the manifest file did not indicate that it recognized the
"Eclipse-BuddyPolicy" entry as an entry. From the error it seems to be
searching the plugin for a source file for AntRunner - though I can't see
a difference between my use of AntRunner and the Activator's use of Bundle
Context, which the plugin has no problems finding. The exact error is:

!ENTRY org.eclipse.osgi 4 0 2009-07-20 18:28:37.687
!MESSAGE An error occurred while automatically activating bundle
edu.wpi.first.javadev (180).
!STACK 0
org.osgi.framework.BundleException: Exception in
edu.wpi.first.javadev.Activator.start() of bundle edu.wpi.first.javadev.
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1028)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:444)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:313)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1274)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:867)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:267)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java:263)
at
org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.crea tePage(WorkbenchPreferenceNode.java:47)
at
org.eclipse.jface.preference.PreferenceDialog.createPage(Pre ferenceDialog.java:1304)
at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.cre atePage(FilteredPreferenceDialog.java:369)
at
org.eclipse.jface.preference.PreferenceDialog.showPage(Prefe renceDialog.java:1195)
at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.sho wPage(FilteredPreferenceDialog.java:570)
at
org.eclipse.jface.preference.PreferenceDialog$10.run(Prefere nceDialog.java:700)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.preference.PreferenceDialog$9.selectionCha nged(PreferenceDialog.java:696)
at
org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredV iewer.java:842)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.firePostSelection Changed(StructuredViewer.java:840)
at
org.eclipse.jface.viewers.StructuredViewer.handlePostSelect( StructuredViewer.java:1153)
at
org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected( StructuredViewer.java:1178)
at
org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(O penStrategy.java:250)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:244)
at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java: 418)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3425)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPrefer encesAction.java:65)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:583)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:500)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/ant/core/AntRunner
at
edu.wpi.first.javadev.SdkAntOperations.install(SdkAntOperati ons.java:25)
at edu.wpi.first.javadev.Activator.start(Activator.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
... 77 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.ant.core.AntRunner
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:481)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 82 more
Root exception:
java.lang.NoClassDefFoundError: org/eclipse/ant/core/AntRunner
at
edu.wpi.first.javadev.SdkAntOperations.install(SdkAntOperati ons.java:25)
at edu.wpi.first.javadev.Activator.start(Activator.java:33)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2 .run(BundleContextImpl.java:1009)
at java.security.AccessController.doPrivileged(Native Method)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tartActivator(BundleContextImpl.java:1003)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.s tart(BundleContextImpl.java:984)
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWor ker(BundleHost.java:346)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.star t(AbstractBundle.java:265)
at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAct ion.java:400)
at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter .postFindLocalClass(EclipseLazyStarter.java:111)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:427)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:193)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:368)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:444)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.loadCl ass(BundleLoader.java:313)
at
org.eclipse.osgi.framework.internal.core.BundleHost.loadClas s(BundleHost.java:227)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.load Class(AbstractBundle.java:1274)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:160)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:867)
at
org.eclipse.core.internal.registry.ConfigurationElement.crea teExecutableExtension(ConfigurationElement.java:243)
at
org.eclipse.core.internal.registry.ConfigurationElementHandl e.createExecutableExtension(ConfigurationElementHandle.java: 51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugi n.java:267)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.WorkbenchPlugin.createExtension(Work benchPlugin.java:263)
at
org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.crea tePage(WorkbenchPreferenceNode.java:47)
at
org.eclipse.jface.preference.PreferenceDialog.createPage(Pre ferenceDialog.java:1304)
at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.cre atePage(FilteredPreferenceDialog.java:369)
at
org.eclipse.jface.preference.PreferenceDialog.showPage(Prefe renceDialog.java:1195)
at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.sho wPage(FilteredPreferenceDialog.java:570)
at
org.eclipse.jface.preference.PreferenceDialog$10.run(Prefere nceDialog.java:700)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.jface.preference.PreferenceDialog$9.selectionCha nged(PreferenceDialog.java:696)
at
org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredV iewer.java:842)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:17 5)
at
org.eclipse.jface.viewers.StructuredViewer.firePostSelection Changed(StructuredViewer.java:840)
at
org.eclipse.jface.viewers.StructuredViewer.handlePostSelect( StructuredViewer.java:1153)
at
org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected( StructuredViewer.java:1178)
at
org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(O penStrategy.java:250)
at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.ja va:244)
at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java: 418)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3425)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPrefer encesAction.java:65)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:583)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:500)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:382)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
Caused by: java.lang.ClassNotFoundException: org.eclipse.ant.core.AntRunner
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:481)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loa dClass(DefaultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 82 more


Thanks for any help
Previous Topic:Transfer Tasklist from GANYMEDE to GALILEO
Next Topic:Get Persistant Global Variable in Java
Goto Forum:
  


Current Time: Sat May 10 12:22:34 EDT 2025

Powered by FUDForum. Page generated in 0.07583 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top