NoClassDefFoundError for Xerces when calling EditorVariables.getAllFrameworksDirs()

Post here questions and problems related to oXygen frameworks/document types.
ctnitchie
Posts: 1

NoClassDefFoundError for Xerces when calling EditorVariables.getAllFrameworksDirs()

Wed May 24, 2017 7:46 pm

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?
Radu
Posts: 5095

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

Thu May 25, 2017 8:53 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests