jbossjboss7.xwss4jxfirexmlsec

JBoss AS 7.1 dependency conflicts due the xfire-1.2.6 dependencies wss4j-1.5.1 and xmlsec 1.3.0


I'm trying to deploy legacy code on JBoss AS 7.1 but I'm struggling with conflicting dependencies due wss4j and xmlsec

I've created a jboss-deployment-structure.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<deployment>
    <!-- Exclusions allow you to prevent the server from automatically adding 
        some dependencies -->
    <exclusions>
        <module name="org.apache.log4j" />
        <module name="org.jboss.logging" />
        <module name="org.jboss.logging.jul-to-slf4j-stub" />
        <module name="org.jboss.logmanager" />
        <module name="org.jboss.logmanager.log4j" />
        <module name="org.slf4j" />
        <module name="javaee.api" />
        <module name="org.apache.santuario.xmlsec" />
    </exclusions>

    <dependencies>
        <module name="javaee.api">
            <imports>
                <exclude-set>
                    <path name="org/apache/xml/security/**" />
                    <path name="org/apache/ws/security/**" />
                </exclude-set>
            </imports>
        </module>
    </dependencies>

</deployment>

But this results in:

Caused by: java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:81) [wss4j-1.5.1.jar:]
at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:95) [wss4j-1.5.1.jar:]
at org.apache.ws.security.WSSConfig.<clinit>(WSSConfig.java:47) [wss4j-1.5.1.jar:]
at org.apache.ws.security.WSSecurityEngine.<clinit>(WSSecurityEngine.java:51) [wss4j-1.5.1.jar:]
at org.apache.ws.security.handler.WSHandler.<clinit>(WSHandler.java:62) [wss4j-1.5.1.jar:]
at com.realdolmen.forens2.service.kbo.impl.KBOConsultServiceImpl.signRequest(KBOConsultServiceI

And when I change the path names to:

<exclude-set>
    <path name="org/apache/xml/security" />
    <path name="org/apache/ws/security" />
</exclude-set>

It results in:

Caused by: java.lang.NoSuchMethodError: org.apache.xml.security.keys.KeyInfo.init()V
at org.apache.xml.security.Init.init(Unknown Source) [xmlsec-1.3.0.jar:]
at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:72) [wss4j-1.5.1.jar:]
at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:95) [wss4j-1.5.1.jar:]

and what's really driving me crazy is that the correct versions appear in the stacktrace.


Solution

  • I've rewritten the legacy code with CXF..