Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » NoClassDefFoundError for IImportStructureProvider
NoClassDefFoundError for IImportStructureProvider [message #326977] Thu, 03 April 2008 19:49 Go to next message
Eclipse UserFriend
Originally posted by: sureshpendap.gmail.com

I have an eclipse plugin application which tries to import an existing
project into the eclipse workspace. Following is the source code

ProgressMonitorOutputStream pm = new ProgressMonitorOutputStream();
pm.beginTask("Create Workspace", 100);
pm.setShowSubTaskChanges(true);
pm.forceRefreshInterval(-1);
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot rootWorkspace = workspace.getRoot();
// IProject project = rootWorkspace.getProject("Sunopsis
Beans");
// IPath workspaceFolder = rootWorkspace.getFullPath();
File directory = new File("C:\\work\\odi_11g\\Sunopsis Marker
Icons");
ImportOperation importOperation = new ImportOperation(
rootWorkspace.getFullPath(),
directory,
FileSystemStructureProvider.INSTANCE,
OVERWRITE_ALL_QUERY);
importOperation.setCreateContainerStructure(false);
importOperation.setContext(null);
importOperation.run(new SubProgressMonitor(pm, 1));

I am getting the followign exception

ava.lang.NoClassDefFoundError:
org/eclipse/ui/wizards/datatransfer/IImportStructureProvider
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at
org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:157)
at
org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:759)
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.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:74)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
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.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)


I have compiled my plugin with java 1.4 and compliance level set to 1.4
and am also running it with java 1.4.

The only thing that i did is that i have added the plugins as external
jars to my project in order to get my project compiled as i was not able
to select the particular plugin jar file in the plugin-in dependencies.
Re: NoClassDefFoundError for IImportStructureProvider [message #326978 is a reply to message #326977] Thu, 03 April 2008 20:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Suresh,

When building plugins, don't ever edit the project's build path
directly. You must use the dependencies tab of the MANIFEST.MF editor
to fix your classpath problems, otherwise the problem will just come
back at runtime as you see here.


suresh pendap wrote:
> I have an eclipse plugin application which tries to import an existing
> project into the eclipse workspace. Following is the source code
>
> ProgressMonitorOutputStream pm = new ProgressMonitorOutputStream();
> pm.beginTask("Create Workspace", 100);
> pm.setShowSubTaskChanges(true);
> pm.forceRefreshInterval(-1);
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> IWorkspaceRoot rootWorkspace = workspace.getRoot();
> // IProject project = rootWorkspace.getProject("Sunopsis
> Beans");
> // IPath workspaceFolder = rootWorkspace.getFullPath();
> File directory = new File("C:\\work\\odi_11g\\Sunopsis
> Marker Icons");
> ImportOperation importOperation = new ImportOperation(
> rootWorkspace.getFullPath(),
> directory,
> FileSystemStructureProvider.INSTANCE,
> OVERWRITE_ALL_QUERY);
> importOperation.setCreateContainerStructure(false);
> importOperation.setContext(null);
> importOperation.run(new SubProgressMonitor(pm, 1));
>
> I am getting the followign exception
> ava.lang.NoClassDefFoundError:
> org/eclipse/ui/wizards/datatransfer/IImportStructureProvider
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
> at java.lang.Class.getConstructor0(Unknown Source)
> at java.lang.Class.newInstance0(Unknown Source)
> at java.lang.Class.newInstance(Unknown Source)
> at
> org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI .createExecutableExtension(RegistryStrategyOSGI.java:157)
>
> at
> org.eclipse.core.internal.registry.ExtensionRegistry.createE xecutableExtension(ExtensionRegistry.java:759)
>
> 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.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:74)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
>
> 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.core.launcher.Main.invokeFramework(Main.java:336 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
>
>
> I have compiled my plugin with java 1.4 and compliance level set to
> 1.4 and am also running it with java 1.4.
>
> The only thing that i did is that i have added the plugins as external
> jars to my project in order to get my project compiled as i was not
> able to select the particular plugin jar file in the plugin-in
> dependencies.
>
>
>
Re: NoClassDefFoundError for IImportStructureProvider [message #326985 is a reply to message #326978] Thu, 03 April 2008 21:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sureshpendap.gmail.com

Thanks!! Ed, i got past the eariler exception after updating the plugin
manifest file. But now i am getting some other exception which is as
follows

java.lang.IllegalArgumentException: Path must include project and resource
name: /.classpath
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
at
org.eclipse.core.internal.resources.Workspace.newResource(Wo rkspace.java:1571)
at
org.eclipse.core.internal.resources.Container.getFile(Contai ner.java:123)
at
org.eclipse.ui.wizards.datatransfer.ImportOperation.importFi le(ImportOperation.java:519)
at
org.eclipse.ui.wizards.datatransfer.ImportOperation.importRe cursivelyFrom(ImportOperation.java:699)
at
org.eclipse.ui.wizards.datatransfer.ImportOperation.importRe cursivelyFrom(ImportOperation.java:708)
at
org.eclipse.ui.wizards.datatransfer.ImportOperation.execute( ImportOperation.java:372)
at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1737)
at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
at sunopsisNightlyBuildPlugin.CreateWorkspace.run(CreateWorkspa ce.java:108)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
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.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

The file system path from which i am trying to import does have the
project and the .classpath files under it. I am not sure if i understand
this exception.
Re: NoClassDefFoundError for IImportStructureProvider [message #326986 is a reply to message #326985] Thu, 03 April 2008 21:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sureshpendap.gmail.com

Hi got past the earlier exception by
just creating an empty project using workspaceRoot.getProject(projectName)
and project.createProject(projectDescription, pm) call


Now the project gets imported into the empty project, however there are
some problems.

1. The project doest not have a java nature attached to it. The .project
file which is copied into the project does have the java nature in its
content.
2. I do not want to physically copy the projects into the workspace
directory, i would like to just link it the actual file system location
where the project is located. I basically just want to register the java
project with the workspace so that when i build the workspace
programmatically it does not say that the resource does not exists.

The ImportOperation seems to be a utility for importing some external
content into an existing project.

What i want is to be able to import an external existing project into the
workspace without actually copying it and without UI
Re: NoClassDefFoundError for IImportStructureProvider [message #326989 is a reply to message #326986] Thu, 03 April 2008 22:37 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Suresh,

When you "create" a project you can specify the physical location for it
in the project description...


Suresh Pendap wrote:
> Hi got past the earlier exception by just creating an empty project
> using workspaceRoot.getProject(projectName) and
> project.createProject(projectDescription, pm) call
>
>
> Now the project gets imported into the empty project, however there
> are some problems.
>
> 1. The project doest not have a java nature attached to it. The
> .project file which is copied into the project does have the java
> nature in its content.
> 2. I do not want to physically copy the projects into the workspace
> directory, i would like to just link it the actual file system
> location where the project is located. I basically just want to
> register the java project with the workspace so that when i build the
> workspace programmatically it does not say that the resource does not
> exists.
>
> The ImportOperation seems to be a utility for importing some external
> content into an existing project.
>
> What i want is to be able to import an external existing project into
> the workspace without actually copying it and without UI
>
Previous Topic:Project export/import and the "derived" flag
Next Topic:Resource change listener interface for deleted IFiles
Goto Forum:
  


Current Time: Sat Nov 09 03:30:06 GMT 2024

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

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

Back to the top