2012-12-13 41 views
0

我試圖在JBoss AS 7.1上部署遺留代碼,但由於wss4j和xmlsec,我正在努力處理衝突的依賴關係由於xfire-1.2.6依賴關係造成的JBoss AS 7.1依賴關係衝突wss4j-1.5.1和xmlsec 1.3.0

我已經創建了一個JBoss的部署,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:] 

,什麼是真正推動我瘋狂的是正確的版本出現在堆棧跟蹤。

+0

我也回答了這個線程對同一問題:https://community.jboss.org/message/783233#783233 –

回答

0

我已經重寫遺留代碼與CXF ..