java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin [message #1058087] |
Fri, 10 May 2013 21:44 |
Robert Smith Messages: 3 Registered: May 2013 |
Junior Member |
|
|
Hi all,
I hope you can help, I'm at the end of my rope. I am writing a very simple headless plugin (extending org.eclipse.core.runtime.applications). The sole purpose of this plugin is import existing sample projects into Eclipse from the command line.
I know that there is a plugin in cdt which already does this. However, this is part of an installer, so can not be allowed to fail and pop up any dialogs.
The relevant code in my IApplication's start() method is:
try
{
System.out.println("In try block");
description = ResourcesPlugin.getWorkspace().loadProjectDescription(new Path(projectName + "/.project"));
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(description.getName());
project.create(description, null);
project.open(null);
System.out.println("Done.");
}
catch (CoreException e)
{
}
Here is my manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Intel Headless Utilities
Bundle-SymbolicName: com.intel.eclipse.headless;singleton:=true
Bundle-Version: 1.0.0.0
Bundle-Activator: com.intel.eclipse.headless.Activator
Bundle-Vendor: Intel
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Note that I have declared a dependency on "org.eclipse.core.resources". Here is the plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="import"
point="org.eclipse.core.runtime.applications">
<application
cardinality="singleton-global"
thread="main"
visible="true">
<run
class="com.xxx.eclipse.headless.Import">
</run>
</application>
</extension>
</plugin>
When I try to run this using "eclipse -consoleLog -data C:\Android\eclipse\workspace -noSplash -application com.xxx.eclipse.headless.import -project C:\Android\eclipse\workspace\helloworld", I get the following error:
!SESSION 2013-05-10 14:11:36.598 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.7.0_21
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -application com.xxx.eclipse.headless.import -import C:/Android/eclipse/workspace/helloworld
Command-line arguments: -data C:\Android\eclipse\workspace -application com.xxx.eclipse.headless.import -import C:/Android/eclipse/workspace/helloworld
!ENTRY org.eclipse.osgi 4 0 2013-05-10 14:11:38.508
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError: org/eclipse/core/resources/ResourcesPlugin
at com.xxx.eclipse.headless.Import.importProject(Import.java:97)
at com.xxx.eclipse.headless.Import.start(Import.java:60)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
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(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
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:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.resources.ResourcesPlugin
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 15 more
I don't understand what the problem could be. I have declared the dependency correctly. What am I missing?
Many thanks,
Robert
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07684 seconds