Page 1 of 1

NoClassDefFoundError for Xerces when calling EditorVariables.getAllFrameworksDirs()

Posted: Wed May 24, 2017 7:46 pm
by ctnitchie
In 18.1, from within an action implemented in a framework, if I call EditorVariables.getAllFrameworksDirs(), I get the following exception:

Code: Select all

java.lang.NoClassDefFoundError: org/apache/xerces/parsers/SAXParser
at ro.sync.exml.options.yf.e(Unknown Source)
at ro.sync.exml.options.yf.k(Unknown Source)
at ro.sync.exml.options.v.h(Unknown Source)
at ro.sync.exml.options.yc.h(Unknown Source)
at ro.sync.exml.options.v.<init>(Unknown Source)
at ro.sync.exml.options.yc.<init>(Unknown Source)
at ro.sync.exml.options.yc.m(Unknown Source)
at ro.sync.exml.options.Options.init(Unknown Source)
at ro.sync.exml.options.Options.init(Unknown Source)
at ro.sync.exml.options.Options.getInstance(Unknown Source)
at ro.sync.exml.options.Options.getInstance(Unknown Source)
at ro.sync.util.editorvars.EditorVariables.getAdditionalFrameworksDirs(Unknown Source)
at ro.sync.util.editorvars.EditorVariables.getAllFrameworksDirs(Unknown Source)
I tried adding "${oxygenHome}/lib/xercesImpl.jar" to the framework classpath, but it doesn't help. How can I configure my framework so that this will work? Alternatively, is there a better way to look up the base directory of a specific framework from Java?

Re: NoClassDefFoundError for Xerces when calling EditorVariables.getAllFrameworksDirs()

Posted: Thu May 25, 2017 8:53 am
by Radu
Hi Chris,

Oxygen has its own class loader which loads all the JAR libraries in its "lib" directory including the Xerces libraries.
Each framework's Java extensions (including actions) run in a separate class loader (which contain all the JAR libraries referenced in the "Classpath" list) which has as parent class loader the Oxygen class loader.
So the "Classpath" list for a framework should be minimal, it should refer only the JAR library containing the custom Java extension implementations, for example it must not refer to the main Oxygen JAR library or to the Xerces library as the parent class loader loads those.
Do you obtain these problems when running Oxygen using its regular startup script or command line executable or do you somehow debug Oxygen by starting it with a custom classpath (from Eclipse for example)?

Regards,
Radu