I found the solution for this. It is a generic problem and not specific to
XMLBeans jars. The external jars used in any eclipse plugin project have to
be added in the Bundle-Classpath entry in manifest.mf (this can be done
using the runtime tab of plugin.xml)

 

  _____  

From: Murali Gunasekaran [mailto:[EMAIL PROTECTED] 
Sent: Saturday, December 23, 2006 2:05 AM
To: user@xmlbeans.apache.org
Subject: RE: Eclipse plugin Exception: java.lang.NoClassDefFoundError: org
/apache/xmlbeans/XmlException

 

Thanks. Here is the complete stack trace. Most of it is related to the
plugin code. The line where the exception occurs (getElements) is where the
class containing the XMLBeans code is accessed (is not part of the trace).

 

 

!ENTRY org.eclipse.ui 4 0 2006-12-22 18:37:13.377

!MESSAGE org/apache/xmlbeans/XmlException

!STACK 0

java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException

            at
com.webmethods.sc.metadata.ui.library.searchfolder.actions.AddEditFolderDial
og$1.getElements(AddEditFolderDialog.java:191)

            at
org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.j
ava:927)

            at
org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredVie
wer.java:868)

            at
org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewe
r.java:984)

            at
org.eclipse.jface.viewers.AbstractListViewer.inputChanged(AbstractListViewer
.java:303)

            at
org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:250)

            at
org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:15
42)

            at
com.webmethods.sc.metadata.ui.library.searchfolder.actions.AddEditFolderDial
og.createAssetTypeControl(AddEditFolderDialog.java:206)

            at
com.webmethods.sc.metadata.ui.library.searchfolder.actions.AddEditFolderDial
og.createDialogArea(AddEditFolderDialog.java:155)

            at
org.eclipse.jface.dialogs.TitleAreaDialog.createContents(TitleAreaDialog.jav
a:165)

            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
com.webmethods.sc.metadata.ui.library.searchfolder.actions.AddEditFolderDial
og.run(AddEditFolderDialog.java:148)

            at
com.webmethods.sc.metadata.ui.library.searchfolder.actions.AddFolderAction.r
un(AddFolderAction.java:55)

            at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)

            at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(Action
ContributionItem.java:539)

            at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionI
tem.java:488)

            at
org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContribu
tionItem.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(EclipseAp
pLauncher.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)

 

  _____  

From: Dhammika [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 22, 2006 10:56 PM
To: user@xmlbeans.apache.org
Subject: RE: Eclipse plugin Exception: java.lang.NoClassDefFoundError:
org/apache/xmlbeans/XmlException

 

Can you please give the complete stack trace

 

Dhammika

 

----------------------------------------------------------------

Hello,

I'm using XMLBeans as part of an Eclipse plugin project. I have already
created a schema and generated the XML types using scomp separately and am
using that JAR in my plugin to write the code.

 

There is no compilation error in the plugin and it builds fine, but when I
launch the runtime workbench to test the plugin, I get the
NoClassDefFoundError. I have tried the following:

 

1.      Adding the xbean.jar and jsr173_1.0_api.jar to the build path
2.      adding the extension org.eclipse.ant.core.extraClasspathEntries
3.      setting the java CLASSPATH variable with xbean.jar

 

But nothing seems to be working... Anyone know why this problem would occur?
Am I missing any required JAR at runtime that is somehow present during
development (compilation)? Anyone with Eclipse plugin development experience
encounter this?

 

Thanks a lot!

Murali

 

Murali Gunasekaran

Software Engineer

webMethods Inc.

703.460.6065

 

Reply via email to