问题
I'm migrating an application from Glassfish 2.1 to Jboss eap 6.0.1. Now I deploy my app in Jboss correctly but it doesn't work. I have made debug and I saw the problem. When the code arrives to this line:
OutputFormat format = OutputFormat(doc);
It fails. I made a new watch of "OutputFormat(doc)" and in the value appears this: Unknown type "org.apache.xml.serialize.OutputFormat"<
This class is inside xerces library. This library is installed as a module in my jboss. I have tried many things:
1.- Exclude jboss library and included the library in my war. Not deploy.
2.- Include my library (no JBoss' library) as a new module and, in the manifest, add this line: Dependencies: myModuleName
. It deploys, but it doesn't work.
3.- The before "solution", and exclude jboss library. Not deploy.
This ocurred when the code arrives at the following line, and I have tried the same solutions:
XPathAPI.selectSingleNode( xmlTempDoc,"//a" )
The error at this time is: Unknown type "org.apache.xpath.XPathAPI"
This packages are in xercesImpl-2.9.1 and xalan-2.7.1 libraries respectively.
Can you help me, please?
Thanks, Regards.
回答1:
Try to exclude the default xalan and xerces libraries that come packaged witn JBoss EAP by adding jboss-deployment-structure.xml under /WEB-INF with below content:
<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>
Then include yours in some path such as /lib folder.
来源:https://stackoverflow.com/questions/22334144/xalan-and-xerces-in-jboss-eap-6-0-1