It's all about the answers!

Ask a question

NoClassDefFoundError trying to load class in another plug-in

Anthony Krowiak (1111512) | asked Dec 07 '11, 5:54 p.m.
I created a plug-in that contributes an operation participant extension that has a configuration schema allowing one to configure the fully qualified name of a class that implements an interface invoked by my participant. To test my operation participant, I created another plug-in containing the implementing class that is named in my operation participant's configuration file - I exported the package too. I deployed both plug-ins to my server. When my operation participant runs and attempts to instantiate the implementing class named in the participant's configuration file, a ClassNotFoundException is thrown.

The question is, how does one deploy the implementing class such that it can be instantiated by my operation participant? Is it necessary to define an extension point for it in the plug-in that contributes the operation participant extension? If so, where can I find information on how to create an extension point and how to access the data defined in the plug-in that contributes the extension? I've hunted for this information in the RTC forums, documents and wiki for several hours and have not been able to find it. I am up against a deadline, any help would be greatly appreciated.

2 answers

permanent link
sam detweiler (12.4k6170200) | answered Dec 08 '11, 8:56 a.m.
I think what you said is that you have created a shell participant, that loads an implementing 'client' class to do the actual work. the 'client' class is configured as a text string in some config file, and loaded on demand.

when your shell attempts to load the configured class, you get a class not found.

I believe classpath is relative to the plugin issuing the 'new' to create an instance of the class. thus it would have to be deployed in the shell plugin's classpath..

I have implemented new 'services' that are accessed by both server and eclipse client side functions, but all these classes are hard coded.. I don't know if the plugin architecture supports arbitrary dynamically loaded code.
here is a link to the forum topic on my service


permanent link
Anthony Krowiak (1111512) | answered Dec 16 '11, 8:37 p.m.
I was able to resolve this by creating an extension point in my plug-in. My code then uses the eclipse core facilities to find the extensions and load the class identified in the extension plug-in.

Your answer

Register or to post your answer.