Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » JavaCore NoClassDefFoundError
JavaCore NoClassDefFoundError [message #239597] Tue, 09 January 2007 16:15 Go to next message
Eclipse UserFriend
Originally posted by: nathan.messer.btinternet.com

I've seen this question posted years ago, but no response given.

I have a plugin, which contains a class with the following method:

public Object loadModel(IFile selection) throws ModelException {

ICompilationUnit icu= JavaCore.createCompilationUnitFrom(selection);
IType type= icu.findPrimaryType();
return type;
}

The plugin works fine in a runtime workbench, but when I deploy it and
run it I get a "NoClassDefFoundError" for JavaCore at that line.

I don't think it's relevant, but the situation is slightly more complex.
This plugin is Plugin A, and it contributes a class through an
extension point for use by plugin B.

PLUGIN A - uses extension point from PLUGIN B

PLUGIN B - creates object with method above using
createExecutableExtension and calls the method

Both PLUGIN A depends on org.eclipse.jdt and org.eclipse.jdt.core

I've also tried with PLUGIN B also dependent on these plugins.

I've checked the plugin jar, and it contains the manifest with the
correct dependencies.

I've included the manifest below.


Any ideas what I'm doing wrong?

Nathan

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ModelHandlers Plug-in
Bundle-SymbolicName: org.patterngen.ModelHandlers;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.patterngen.modelhandlers.ModelHandlersPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.jdt.core,
org.eclipse.jdt,
org.eclipse.emf.ecore,
org.eclipse.core.resources,
org.patterngen.PatternModel,
org.patterngen.PatternGen,
org.aspectj.runtime
Eclipse-LazyStart: true
Export-Package: org.patterngen.modelhandlers
Re: JavaCore NoClassDefFoundError [message #239608 is a reply to message #239597] Tue, 09 January 2007 23:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

> I have a plugin, which contains a class with the following method:
>
> public Object loadModel(IFile selection) throws ModelException {
>
> ICompilationUnit icu= JavaCore.createCompilationUnitFrom(selection);
> IType type= icu.findPrimaryType();
> return type;
> }
>
> The plugin works fine in a runtime workbench, but when I deploy it and run
> it I get a "NoClassDefFoundError" for JavaCore at that line.


Which line is "that line"?

Have you tried stepping into the JDT methods being called, or setting a
breakpoint on NCDFE and seeing exactly where it's being thrown from?

Sometimes failure to load a plug-in, ie because of a NullPointerException in
its constructor or start() method, can show up as an NCDFE of a class being
loaded from that plug-in. Try putting break points in those methods and see
if they're returning successfully.

And, just to check, did you try running eclipse -clean? Sometimes I mess
myself up by deploying a non-working plug-in and then when I finally get it
working the old one is still cached so my fixed code is not getting called.


> I don't think it's relevant, but the situation is slightly more complex.
> This plugin is Plugin A, and it contributes a class through an extension
> point for use by plugin B.
>
> PLUGIN A - uses extension point from PLUGIN B
>
> PLUGIN B - creates object with method above using
> createExecutableExtension and calls the method
>
> Both PLUGIN A depends on org.eclipse.jdt and org.eclipse.jdt.core
>
> I've also tried with PLUGIN B also dependent on these plugins.
>
> I've checked the plugin jar, and it contains the manifest with the correct
> dependencies.
>
> I've included the manifest below.


It would be helpful if you could say which one is plug-in A, B, etc. in the
terms of the manifest. Am I correct that plug-in A also depends on plug-in
B? What does B's manifest look like? (Does it export the packages you
need?)


>
>
> Any ideas what I'm doing wrong?
>
> Nathan
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: ModelHandlers Plug-in
> Bundle-SymbolicName: org.patterngen.ModelHandlers;singleton:=true
> Bundle-Version: 1.0.0
> Bundle-Activator: org.patterngen.modelhandlers.ModelHandlersPlugin
> Bundle-Localization: plugin
> Require-Bundle: org.eclipse.core.runtime,
> org.eclipse.jdt.core,
> org.eclipse.jdt,
> org.eclipse.emf.ecore,
> org.eclipse.core.resources,
> org.patterngen.PatternModel,
> org.patterngen.PatternGen,
> org.aspectj.runtime
> Eclipse-LazyStart: true
> Export-Package: org.patterngen.modelhandlers
Re: JavaCore NoClassDefFoundError [message #239682 is a reply to message #239608] Wed, 10 January 2007 15:29 Go to previous message
Eclipse UserFriend
Originally posted by: nathan.messer.btinternet.com

Opps, -clean did indeed solve the problem. I should know better.

Thanks,
Nathan
Previous Topic:Externalize Strings Wizard
Next Topic:How to Programmatically import Existing Project into workspace ?
Goto Forum:
  


Current Time: Wed Jul 23 10:42:24 EDT 2025

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

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

Back to the top