I am attempting to create an Apache Jena based application on JBoss7.
Apache Jena uses Xalan 2.11.0 JBoss 7 ships with 2.7.1
When I attempt to call the application I get an exception, the root of which is:
org.apache.xerces.impl.dv.DVFactoryException: Schema factory class org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl does not extend from SchemaDVFactory
I suspect this is because of the difference in version. I read through the Module documentation (https://docs.jboss.org/author/display/MODULES/Introduction) and attempted to change ot Xalan 2.11.0, but no luck: Jboss just froze on startup. Has anybody done this successfully or, alternatively, does anyone know how to override the Xalan for a deployment?
Thx
JBoss 7 or JBoss EAP 6 ships with its own xalan version, that you can find among its modules, in jboss eap 6.1:
<JBoss Home>/modules/system/layers/base/org/apache/xalan/main
if you want to use your own first you have to exclude jboss xalan with the below jboss deployment descriptor in /WEB-INF/jboss-deployment-structure.xml
for war and /META-INF/jboss-deployment-structure.xml
for ear:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="org.apache.xalan" />
<module name="org.apache.xerces" />
</exclusions>
</deployment>
</jboss-deployment-structure>
I excluded also Xerces, because usually they are bundled toghether.
Problem in the CBU (Carbon Based Unit) I was playing with xalan when I should have been playing with xerces. It is xerces 2.11 (DOH)
The easiest is to maybe deploy your application with /WEB-INF/jboss-deployment-structure.xml
and explicitly exclude JBoss-provided libraries that you want to override, and then just package them yourself in the application, e.g. /WEB-INF/lib/xalan-2.11.0.jar
Here's an example of jboss-deployment-structure.xml:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.apache.xalan" />
<module name="SOME.OTHER.MODULE.YOU.DONT.WANT.JBOSS.TO.PROVIDE" />
</dependencies>
</deployment>
</jboss-deployment-structure>
I have not tested this, though. Try it if it works and report. We'll try another approach if that doesn't work.
来源:https://stackoverflow.com/questions/21207490/jboss-7-1-xalan-issue