【问题标题】:JBoss AS 7.1 dependency conflicts due the xfire-1.2.6 dependencies wss4j-1.5.1 and xmlsec 1.3.0由于 xfire-1.2.6 依赖 wss4j-1.5.1 和 xmlsec 1.3.0,JBoss AS 7.1 依赖冲突
【发布时间】:2012-12-13 08:55:12
【问题描述】:

我正在尝试在 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:]

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

【问题讨论】:

标签: jboss jboss7.x wss4j xfire xmlsec


【解决方案1】:

我已经用 CXF 重写了旧代码..

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 2019-12-24
    • 2021-12-14
    • 2022-01-24
    相关资源
    最近更新 更多