2013-02-21 179 views
1

當我將jboss-deployment-structure.xml添加到我的.war中並在AS7中進行部署時,出現以下錯誤。Jboss AS7 - jboss-deployment-structure.xml部署錯誤

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1] 
Message: Unexpected element '{urn:jboss:deployment-structure:1.2}jboss-deployment-structure' 
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108) [staxmapper-1.1.0.Final.jar:1.1.0.Final] 
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final] 

下面附帶示例xml。

<jboss-deployment-structure> 
    <deployment> 
     <exclusions> 
      <module name="org.apache.log4j" /> 
     </exclusions> 
    </deployment> 
</jboss-deployment-structure> 

是否有任何理由解決部署錯誤?

回答

4

它看起來好像抱怨你沒有指定名稱空間。我更新了documentation以排除log4j以添加名稱空間。

試試這個:

<?xml version="1.0" encoding="UTF-8"?> 
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"> 
    <deployment> 
     <exclusions> 
      <module name="org.apache.log4j" /> 
     </exclusions> 
    </deployment> 
</jboss-deployment-structure> 
+0

感謝。有用。 – kds 2013-02-22 11:16:58

+2

請注意,** urn:jboss:deployment-structure:1.2 **不適用於JBoss AS 7.1.1。對於這個版本的JBoss,使用** jboss:deployment-structure:1.1 **(參見[comment](https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7?focusedCommentId=53379592 #comment-53379592)) – 2015-05-20 13:19:09

+0

和** deployment-structure:1.2 **從JBoss AS 7.1.2/EAP 6.x開始可用:參見source [xsd](https://github.com/jbossas/jboss-如/斑點/ 7.1.2.Final /建造/ SRC /主/資源/文檔/模式/ JBoss的部署結構-1_2.xsd) – 2015-05-20 13:28:21