views:

155

answers:

1

I'm working with a library (MDHT from OpenHealthTools) to parse CDA XML.
It relies on parts of Eclipse and the EMF plugin for Eclipse to do its thing. I've addressed most of the dependencies, but I'm still running into this error:

Could not initialize class org.eclipse.core.runtime.Platform
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.core.runtime.Platform
        at org.openhealthtools.mdht.uml.cda.internal.registry.CDARegistry.load(CDARegistry.java:41)
        at org.openhealthtools.mdht.uml.cda.internal.registry.CDARegistry.getEClass(CDARegistry.java:67)
        at org.openhealthtools.mdht.uml.cda.internal.resource.CDALoadImpl.handleTemplate(CDALoadImpl.java:144)
        at org.openhealthtools.mdht.uml.cda.internal.resource.CDALoadImpl.processNode(CDALoadImpl.java:110)
        at org.openhealthtools.mdht.uml.cda.internal.resource.CDALoadImpl.traverse(CDALoadImpl.java:94)
        at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.traverse(XMLLoadImpl.java:555)
        at org.openhealthtools.mdht.uml.cda.internal.resource.CDALoadImpl.traverse(CDALoadImpl.java:95)
        at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:406)
        at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:615)
        at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.load(XMLResourceImpl.java:579)
        at org.openhealthtools.mdht.uml.cda.util.CDAUtil.load(CDAUtil.java:66)
        at org.openhealthtools.mdht.uml.cda.util.CDAUtil.load(CDAUtil.java:58)
        at com.mirth.results.models.serializer.CDAConverter.convertCDAToClinicalDocumentModel(CDAConverter.java:23)
        at com.mirth.results.models.serializer.CDAConverterTest.testConvertCDAToClinicalDocumentModel(CDAConverterTest.java:42)


Java Result: 2

I have placed the JAR from Eclipse with org.eclipse.core.runtime.Platform on the classpath. Does it have additional dependencies?

+1  A: 

You can try and see if a similar set of core eclipse plugins used for ATL could be needed for your MDHT plugin as well.
Especially:

Eclipse libraries

    * org.eclipse.equinox.common_3.3.*.jar
    * org.eclipse.core.jobs_3.3.*.jar
    * org.eclipse.core.runtime.compatibility_3.*.jar
    * org.eclipse.core.runtime_3.3.*.jar
    * org.eclipse.core.resources_3.3.*.jar
    * org.eclipse.osgi_3.3.*.jar 

(Note: this is a bit old -- eclipse 3.3 -- so you need to adapt that list to the version of eclipse you are running)

VonC
That plus an equiniox.registry JAR did it. Thx!
Freiheit