Bugfixing: “Current operation not available” in Eclipse

Symptoms:  The following error message pops up in Eclipse “Current operation not available” while testing a new plugin (via context menu “Run as-> Eclipse Application”)

Diagnostic: Checking the Eclipse logs in eclipse\runtime-EclipseApplication\.metadata\.log shows:

!ENTRY org.eclipse.equinox.registry 4 1 2008-03-26 10:34:13.953
!MESSAGE Plug-in “Plugin” was unable to instantiate class “popup.actions.PluginAction”.
java.lang.NoClassDefFoundError: org/eclipse/jdt/core/JavaModelException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)

The plugin cannot find a class referenced in its source code (in this case  org.eclipse.jdt.core.JavaModelException) and then fails to load.

Fix: edit the META-INF/MANIFEST.FM file associated with the plugin and add the necessary package under “Require-Bundle” (eg. org.eclipse.jdt.core).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s