aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes NoClassDefFoundError in Plugin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "NoClassDefFoundError in Plugin " Watch "NoClassDefFoundError in Plugin " New topic
Author

NoClassDefFoundError in Plugin

deepa anandan
Greenhorn

Joined: Jun 06, 2006
Posts: 24
In my plugin application there is a reference to a class present in another plugin application.
Once the plugin is loaded and once i click on the icon on eclipse toolbar i am reported with NoClassDefFoundError error.

My plugin class NewAdaptationproject is refering to a class NewAdaptationProjectPage present in another plugin com.nokia.oss.sdk.adaptation.ui.

Please find my plugins manifest files:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MPlugin Plug-in
Bundle-SymbolicName: mPlugin; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: mPlugin.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.runtime.compatibility,
org.eclipse.core.runtime.compatibility.auth,
org.eclipse.ui.ide,
com.nokia.oss.sdk,
com.nokia.oss.sdk.adaptation.ui
Eclipse-LazyStart: true
Import-Package: com.nokia.oss.sdk.adaptation.core.wizard,
com.nokia.oss.sdk.adaptation.edit,
com.nokia.oss.sdk.adaptation.ui.editor.framework,
com.nokia.oss.sdk.adaptation.ui.wizard,
org.eclipse.ui.dialogs,
org.eclipse.ui.wizards.datatransfer,
org.eclipse.ui.wizards.newresource

=========================================================

My plugin.xml where in requires tag i have included other plugin

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
id="mPlugin"
name="MPlugin Plug-in"
version="1.0.0"
provider-name=""
class="mPlugin.MPluginPlugin">
<runtime>
<library name="mPlugin.jar">
<export name="*"/>
</library>

</runtime>

<requires>
<import plugin="com.nokia.oss.sdk.adaptation.ui"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="com.nokia.oss.sdk.adaptation.core"/>
</requires>

<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Sample Action Set"
visible="true"
id="mPlugin.actionSet">
<menu
label="File"
id="File">
<separator
name="fileGroup">
</separator>
</menu>

<action
label="&MoecatImporter"
icon="icons/sample.gif"
class="mPlugin.actions.SampleAction"
tooltip="New MoecatImporter Plugin Real"
menubarPath="file/fileGroup"
toolbarPath="sampleGroup"
id="mPlugin.actions.SampleAction">
</action>

</actionSet>
</extension>

</plugin>



The error stack trace:

java.lang.NoClassDefFoundError: com/nokia/oss/sdk/adaptation/ui/wizard/NewAdaptationProjectPage
at mPlugin.actions.NewAdaptationproject.addPages(NewAdaptationproject.java:74)
at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:499)
at org.eclipse.jface.window.Window.create(Window.java:426)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1124)
at org.eclipse.jface.window.Window.open(Window.java:785)
at mPlugin.actions.SampleAction.run(SampleAction.java:71)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:254)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)


Looks like at runtime it checks the requires tag in plugin.xml but in the above case i have included the dependent plugin under requires tag. Couldnt trace what exactly causes this error

The same application was wprking fine in eclipse 3.1.2 but the error occured in Eclispe version 3.2

Please let me know the cause and the solution..

Any help would be highly appreciated...
Thanks in advance

[edited to escape XML]
[ August 26, 2006: Message edited by: Jeanne Boyarsky ]
deepa anandan
Greenhorn

Joined: Jun 06, 2006
Posts: 24
Is there anyone who can provide me solution..???
deepa anandan
Greenhorn

Joined: Jun 06, 2006
Posts: 24
i have cleaned up my project and rebuilt it. Now I am able to see my plugin being deployed in Plugin registry but when ever i activate it i get ClassNotFoundException:

=======================================================================
java.lang.ClassNotFoundException: mPlugin.actions.SampleAction
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:407)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:276)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1245)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:147)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:759)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:51)
at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:242)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:238)
at org.eclipse.ui.internal.PluginAction.createDelegate(PluginAction.java:120)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:225)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
=========================================================================


but my plugin.xm file clearly specifies the class path:



<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin<br /> id="mPlugin"<br /> name="MPlugin Plug-in"<br /> version="1.0.0"<br /> provider-name=""<br /> class="mPlugin.Activator">

<runtime>
<library name="mPlugin.jar">
<export name="*"/>
</library>

</runtime>

<requires>
<import plugin="com.nokia.oss.sdk.adaptation.ui"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui.ide"/>
<import plugin="com.nokia.oss.sdk.adaptation.core"/>
<import plugin="org.eclipse.jface"/>
</requires>

<extension<br /> point="org.eclipse.ui.actionSets">
<actionSet<br /> label="Sample Action Set"<br /> visible="true"<br /> id="mPlugin.actionSet">
<menu<br /> label="File"<br /> id="File">
<separator<br /> name="fileGroup">
</separator>
</menu>

<action<br /> label="&MoecatImporter"<br /> icon="icons/sample.gif"<br /> class="mPlugin.actions.SampleAction"<br /> tooltip="New MoecatImporter Plugin Real"<br /> menubarPath="file/fileGroup"<br /> toolbarPath="sampleGroup"<br /> id="mPlugin.actions.SampleAction">
</action>

</actionSet>
</extension>



</plugin>

Please let me know where i have gone wrong.......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError in Plugin