Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Class not found which is actually present  () 2 Votes
Class not found which is actually present [message #516345] Tue, 23 February 2010 11:08 Go to next message
Eclipse UserFriend
Hi all,

I've built my first RCP application using Maven's PDE plug-in. However, it crashes upon launch, leaving the following message in workspace/.metadata/.log:

Quote:

java.lang.NoClassDefFoundError: org/eclipse/jface/dialogs/Dialog
at java.lang.ClassLoader.defineClass1(Native Method)
(...)



In the application's plugins folder, I have a file org.eclipse.jface_3.3.1.M20070910-0800b.jar, which contains the Dialog class that is supposedly missing. Any ideas why this class is not found?

Thanks,
Ulrich
Re: Class not found which is actually present [message #516391 is a reply to message #516345] Tue, 23 February 2010 15:21 Go to previous messageGo to next message
Eclipse UserFriend
I have a similar problem: I have an RCP application which is referencing a class in a jar (external jar) which is part of another Eclipse plugin project (external project). I have included the external plugin as a required plugin in the "Dependencies" section of the application's plugin.xml and in the "Configuration" section of the product.xml . Also, I have added the external jar as an "Extra Classpath Entry" in the "Build Configuration" section of the applications plugin.xml.

The application compiles and runs well until it reaches the code segment that references the external class, resulting in a NoClassDefFoundError :

!ENTRY org.eclipse.ui 4 0 2010-02-23 15:17:39.417
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: edu/mit/ll/tadlsimulator/time/TADLTimeStamp
...........................
Caused by: java.lang.ClassNotFoundException: edu.mit.ll.tadlsimulator.time.TADLTimeStamp
at org.eclipse.osgi.framework.internal.core.BundleLoader.findCl assInternal(BundleLoader.java:481)

Any ideas? I have been trying to fix this for a while and nothing seems to work. Any help will be really appreciated.

Thanks,

Joel

Re: Class not found which is actually present [message #516585 is a reply to message #516391] Wed, 24 February 2010 08:28 Go to previous messageGo to next message
Eclipse UserFriend
joel.acevedo@gmail.com wrote:
> I have a similar problem: I have an RCP application which is referencing
> a class in a jar (external jar) which is part of another Eclipse plugin
> project (external project). I have included the external plugin as a
> required plugin in the "Dependencies" section of the application's
> plugin.xml and in the "Configuration" section of the product.xml . Also,
> I have added the external jar as an "Extra Classpath Entry" in the

A good rule of thumb is "plugins can only see other plugins". So you
need to have that other plugin available in your RCP application.

The "Extra Classpath Entry" field will only allow you to compile your
plugin project, but does nothing for trying to run it. When you run,
the only classes a plugin can see are those exported by the plugin's
"Required-Bundles" and those in packages in Import-Package statements.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: Class not found which is actually present [message #516597 is a reply to message #516345] Wed, 24 February 2010 09:24 Go to previous message
Eclipse UserFriend
In case it helps, here are a few more details:

Upon launch, the program wants to open a custom dialog, whose class is a subclass of org.eclipse.jface.dialogs.Dialog and defined in another bundle (which is also present in plugins/). There are no direct references to the jface.Dialog base class in my application class, only to the derived class (which is apparently found). There seem to be no general classpath problems, as other external classes I use (such as org.eclipse.swt.widgets.MessageBox) work. The cause for my error is a ClassNotFoundException, however, so there's definitely something going wrong with locating the base class. Only it's right there in the jar Confused Any ideas what might be causing this behavior?

Edit: It works now, though I have no idea what change I made that fixed it...

[Updated on: Wed, 24 February 2010 11:31] by Moderator

Previous Topic:FormText with tooltip?
Next Topic:Adding a custom view to the RCP perspective
Goto Forum:
  


Current Time: Mon Jun 23 23:41:19 EDT 2025

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

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

Back to the top