I have an eclipse plugin and have created and a new Extension point with all setting shown in the link: http://www.vogella.com/tutorials/EclipseExtensionPoint/article.html
Now created a new plugin with an extension using this Extension point, also shown in the link above. Now When I run this in my debug environment, it all works fine BUT when I export both these plugin from Eclipse in to plug-in jar file and use it with my application, it fails.
Here is the code to get plugin info that I got from Eclipse website:
IExtensionRegistry reg = Platform.getExtensionRegistry();
IExtensionPoint ep = reg.getExtensionPoint("com.proper.package.ProperExtPointId");
IExtension[] extensions = ep.getExtensions();
contributors = new ArrayList();
for (int i = 0; i < extensions.length; i++)
{
IExtension ext = extensions[i];
IConfigurationElement[] ce =
ext.getConfigurationElements();
for (int j = 0; j < ce.length; j++)
{
Object obj = ce[j].createExecutableExtension("ProperExtPointClass");
contributors.add(obj);
}
}
The Code fails with in the CoreException: org.eclipse.core.runtime.CoreException: Plug-in TempPlugin5 was unable to load class com.....(This the class that implements the interface of the plugin that has Extension Point) . . Caused by: java.lang.NoClassDefFoundError: com.IInterface
All these setting work fine when run to debug these plugins in Eclipse with all dependent plugins loaded, But fails when exported to be used as plug-in jar in my application.
Tried remotedebugging, the code fails in this line:
Object obj = ce[j].createExecutableExtension("ProperExtPointClass");
I have tried to look for this kind of issue both could not find. I feel I am missing some dependency that is available by Eclispe when Debugging but unavailable when exported plugin to use the full application.
To Sum it all: Plugin1 that has the extension point and Interface. And PLugin2(depends on Plugin1) that uses this Extension point, and implements the interface of the plugin1. according to Stacktrace: Plugin2 is unable to see the Interface of the Plugin1. I have the package of Interface in the "Exported packages" in "runtime" tab of Plugin1.
TIA.
NoClassDefFoundError
something in the build has got borked – jrtapsell