[jboss-dev-forums] [JBoss AS 7 Development] - exclude XMLSEC and XALAN

andrew.sc.syd do-not-reply at jboss.com
Thu May 9 02:59:17 EDT 2013


andrew.sc.syd [https://community.jboss.org/people/andrew.sc.syd] created the document:

"exclude XMLSEC and XALAN"

To view the document, visit: https://community.jboss.org/docs/DOC-48738

--------------------------------------------------------------
AS 7.1.1.
I'm experiencing a version incompatibility between the XMLSEC (Santuario) and XALAN libraries used by Jboss. The error comes at the point where XMLSEC attempts to instatiate an XpathContext object. The XpathContext, in urn, has a private DTMManager which is being created by newInstance(). The newInstance returns an instance of org.apache.xml.dtm.ref.DTMManagerDefault which canot be cast to org.apache.xml.dtm.DTMManager. The XMLSecurityRuntimeException forgets to mention the original cause of ClassCastException. 

So, I'd rather use my own versions of XMLSEC and XALAN. I saw how JBoss uses it's own version of XMLSEC. It even replaces the version incorporated into the JDK. Here is the snippet from definition of javaee.api

|      | <module name="org.apache.santuario.xmlsec" export="true"> |
|          | <exports> |
|              | <include-set> |
|                  | <path name="javax/xml/crypto"/> |
|                  | <path name="javax/xml/crypto/dom"/> |
|                  | <path name="javax/xml/crypto/dsig"/> |
|                  | <path name="javax/xml/crypto/dsig/dom"/> |
|                  | <path name="javax/xml/crypto/dsig/keyinfo"/> |
|                  | <path name="javax/xml/crypto/dsig/spec"/> |
|              | </include-set> |
|          | </exports> |
|      | </module> |

I read the advice given at  https://community.jboss.org/message/637818#637818 https://community.jboss.org/message/637818
So, I tried my hand. In jboss-deployment-structure.xml I excluded the XmlSec used by Jboss 

<jboss-deployment-structure>
    <deployment>
        <exclusions>                
            <module name="org.apache.xalan" />            
            <module name="org.apache.santuario.xmlsec"/>
        </exclusions>
        <dependencies>
            <module name="javaee.api" >
                <imports>
                    <exclude-set>
                             <path name="org.apache.santuario.xmlsec"/>
                    </exclude-set>
                </imports>
            </module>                        
        </dependencies>
    </deployment>
</jboss-deployment-structure>

For some reason, it did not work. I can still see in the stack trace xmlsec.1.5.1 which is the JBoss version

Regards,
Andrew
--------------------------------------------------------------

Comment by going to Community
[https://community.jboss.org/docs/DOC-48738]

Create a new document in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130509/974c1346/attachment-0001.html 


More information about the jboss-dev-forums mailing list