由于xfire-1.2.6依赖关系wss4j-1.5.1和xmlsec 1.3.0,JBoss AS 7.1依赖性冲突

时间:2012-12-13 08:55:12

标签: jboss jboss7.x wss4j xfire xmlsec

我正在尝试在JBoss AS 7.1上部署遗留代码,但由于wss4j和xmlsec

我正在努力解决冲突的依赖关系

我已经创建了一个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>

但结果是:

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

当我将路径名改为:

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

结果是:

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:]

让我疯狂的是,堆栈跟踪中出现了正确的版本。

1 个答案:

答案 0 :(得分:0)

我用CXF重写了遗留代码..