-->

Jboss AS7 - jboss-deployment-structure.xml deploym

2020-07-30 02:22发布

问题:

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?

回答1:

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>


标签: jboss7.x