1

When I add the jboss-deployment-structure.xml in to my .war and deploy in the AS7 giving the following error.

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]

Sample xml is attached below.

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

Is there any reason why I get the deployment error?

kds
  • 28,155
  • 9
  • 38
  • 55

1 Answers1

5

It looks like it's complaining that you haven't specified the namespace. I updated the documentation for excluding log4j to add the namespace.

Try this:

<?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>
James R. Perkins
  • 16,800
  • 44
  • 60
  • 2
    Be careful, **urn:jboss:deployment-structure:1.2** is not available with JBoss AS 7.1.1. For this version of JBoss use **jboss:deployment-structure:1.1** (see [comment](https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7?focusedCommentId=53379592#comment-53379592)) – Guillaume Husta May 20 '15 at 13:19
  • And **deployment-structure:1.2** is available starting from JBoss AS 7.1.2 / EAP 6.x : see source [xsd](https://github.com/jbossas/jboss-as/blob/7.1.2.Final/build/src/main/resources/docs/schema/jboss-deployment-structure-1_2.xsd) – Guillaume Husta May 20 '15 at 13:28