ClassNotFound for class in dependency and can't debug [message #881578] |
Mon, 04 June 2012 17:30  |
Eclipse User |
|
|
|
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 #881950 is a reply to message #881868] |
Tue, 05 June 2012 10:30  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04552 seconds