xalan and xerces in jboss eap 6.0.1

混江龙づ霸主 提交于 2020-01-15 07:03:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!