Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » InjectionException: java.lang.NoClassDefFoundError: XmlSchemaCollection(Eclipse 4.2 plugin-project-problem)
InjectionException: java.lang.NoClassDefFoundError: XmlSchemaCollection [message #917156] Wed, 19 September 2012 21:44 Go to next message
Bert Verhees is currently offline Bert VerheesFriend
Messages: 2
Registered: September 2012
Junior Member
Hi all,

I hope someone can help me with this following question.

I have a main-plugin-project.

In addition I have a feature-project, a reference_model-plugin-project and a service-plugin-project, which has a singleton-construction to instantiate the classes from the reference_model-plugin-project.

In the reference_model-plugin-project there are several reference_models created from XSD-files. For this I use the Apache xmlschema-core-2.0.3.jar.
It is in the .classpath, and in this way I use it to read the XSD-files.
The XSD-files are read in the constructors of the classes handling the different reference-models.

In the main-plugin-project, this information is used to do things with the interface.

Now my problem, as soon as I call the reference_model-plugin-project over the service-plugin-project in the main-plugin-project like this:

@PostConstruct
public void createControls(Composite parent){
   parent.setLayout(new GridLayout(1, false));
   //more interface stuff
   //call the referencemodel
   final IReferenceModelSchema model = AModelService.getInstance(); //<<-- Here the Exception occurs
   for(Entry<String, SimpleSchemaItem> ssi:openehr.getRootMap().entrySet()){
      treeItem  = new TreeItem (previousItem, SWT.NONE);
      treeItem.setText(ssi.getKey());
   }
}


Then an Exception occurs. The exception complains about it cannot see the XmlSchemaCollection which is used in the reference_model-plugin-project.

How can I solve this problem?

Thanks very much in advance.

Below the Exception stacktrace:

!SESSION 2012-09-19 22:55:51.921 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_24
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=nl_NL
Framework arguments: -product nl.rosa.openehr.archetype_editor.product
Command-line arguments: -product nl.rosa.openehr.archetype_editor.product -data /home/verhees/workspaceRCP/../runtime-nl.rosa.openehr.archetype_editor.product -dev file:/home/verhees/workspaceRCP/.metadata/.plugins/org.eclipse.pde.core/nl.rosa.openehr.archetype_editor.product/dev.properties -os linux -ws gtk -arch x86_64 -consoleLog

!ENTRY org.eclipse.e4.ui.workbench 4 0 2012-09-19 22:55:56.552
!MESSAGE Unable to create class 'nl.rosa.openehr.archetype_editor.ui.parts.OpenEHRViewPart' from bundle '7'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchemaCollection
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:857)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:111)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:318)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:240)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:161)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:102)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:141)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:889)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:623)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:725)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$2(PartRenderingEngine.java:696)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$7.run(PartRenderingEngine.java:690)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:675)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1042)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:67)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4291)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:187)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:57)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$7.widgetSelected(StackRenderer.java:848)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1300)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1285)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3023)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1730)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:270)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1022)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:916)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:150)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)

Caused by: java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/XmlSchemaCollection
at nl.rosa.openehr.archetype_editor.reference_model.SchemaBase.createXmlSchema(SchemaBase.java:45)
at nl.rosa.openehr.archetype_editor.reference_model.openehr.v102.OpenEHRRM102.<init>(OpenEHRRM102.java:11)
at nl.rosa.openehr.archetype_editor.service.openehr.v102.OpenEHRv102Service.<clinit>(OpenEHRv102Service.java:7)
at nl.rosa.openehr.archetype_editor.ui.parts.OpenEHRViewPart.createControls(OpenEHRViewPart.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
... 67 more

Caused by: java.lang.ClassNotFoundException: org.apache.ws.commons.schema.XmlSchemaCollection
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 76 more
Re: InjectionException: java.lang.NoClassDefFoundError: XmlSchemaCollection [message #918128 is a reply to message #917156] Thu, 20 September 2012 19:21 Go to previous message
Bert Verhees is currently offline Bert VerheesFriend
Messages: 2
Registered: September 2012
Junior Member
I found the answer myself, the library xmlschema-core-2.0.3.jar must not be in the .classpath of the plugin using it, but I put in the dropin-folder, so it becomes used as a plugin. Then it works fine.
Previous Topic:ApplyPreferences causes Default Preferences to disappear
Next Topic:org.eclipse.swt.SWTException when using a command in a conditional-subitem
Goto Forum:
  


Current Time: Sat Dec 20 17:16:46 GMT 2014

Powered by FUDForum. Page generated in 0.02202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software