Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ClassNotFound for class in dependency and can't debug(Unable to load class in dependency plugin. Works fine when developing, fails when deployed.)
ClassNotFound for class in dependency and can't debug [message #881578] Mon, 04 June 2012 21:30 Go to next message
James Leone is currently offline James LeoneFriend
Messages: 13
Registered: July 2009
Junior Member
I have 2 custom plugins created for an old version of Eclipse. We are porting them to Eclipse 3.7. When editing and debugging the code in PDE everything works fine. I launch a debug instance of the IDE and the two plugins are loaded and behave well. Plugin B depends on plugin A and declares that dependency in it's plugin.xml .

When we export and deploy the plugins, there are problems.

To test it out, I put the two JAR files for the plugins in eclipse/plugins folder. I start eclipse. I attempt to access the Prefence page for plugin A, no problems. I get an error when accessing the Preferences page for plugin B. I look at the workspace log file and see a ClassNotFound stack trace stemming from the class in plugin B that constructs the preference page.

Plugin B is calling a class from plugin A in that piece of code.

I go to Help > About Eclipse Platform and check to make sure the expected versions of both plugin A & B are loaded - sure enough they are.

Something is odd here. I am assuming it is rooted in the way the new Eclipse platform loads the plugins. What makes it very difficutl is that everything works fine when I am writing the plugin code and launch Eclipse Application from within PDE (using Run as Product default of org.eclipse.platform.ide).

Is there any way I can debug this problem without spending hours getting intimate with the plugin loader?
Re: ClassNotFound for class in dependency and can't debug [message #881723 is a reply to message #881578] Tue, 05 June 2012 06:47 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
Which plug-in holds the class which is not found? Is it A or B or some other plug-in?

Do you specify the dependency really in plugin.xml and not in the manifest.mf?

Did you use the 'Automated Management of Dependencies' on the dependencies Tab of the PDE Manifest editor?
Re: ClassNotFound for class in dependency and can't debug [message #881868 is a reply to message #881723] Tue, 05 June 2012 12:01 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

What do the MANIFEST.MF look like in pluginA and pluginB? If your dependencies really are in your plugin.xml, you need to use PDE Tools to turn them from plugin.xml specification into an OSGi MANIFEST.MF

PW


Re: ClassNotFound for class in dependency and can't debug [message #881950 is a reply to message #881868] Tue, 05 June 2012 14:30 Go to previous message
James Leone is currently offline James LeoneFriend
Messages: 13
Registered: July 2009
Junior Member
Thank you for the input. I was able to get things working.

In this case, plugin B was dependent on plugin A (this was defined in plugin.xml). The class error occurred when plugin B referenced classes in plugin A at runtime.

I was poking around the different plugins that shipped with eclipse and I noticed that the structure of the plugins had changed a bit. It used to be that the plugin was a jar, in that jar was a jar of the plugin code, the plugin.xml file, the manifest, and various subfolders for assets used by the plugin (icons, etc.).

It seems the jar within a jar approach is out. Now it looks like the .class files reside in subfolders directly within the primary jar file.

That didn't work, but I went back to the really old structure (creating a folder with the plugin name and version in the eclipse/plugins directory). Beneath that I have the jar of plugin code, the plugin.xml, icons subfolder, etc.

Works fine.

I'm not sure why PDE didn't "upgrade" the process for packaging the plugins, but it's working now so I am pleased.
Previous Topic:Check project nature of closed projects
Next Topic:org.eclipse.core.runtime.adaptor.FileManager cannot be resolved
Goto Forum:
  


Current Time: Fri Apr 19 23:10:57 GMT 2024

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

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

Back to the top