2 Replies Latest reply on Feb 19, 2015 2:56 PM by wolfgangknauf

    "jboss-deployment-structure.xml" with schemaLocation

    wolfgangknauf

      Hi,

       

      I tried to create a "jboss-deployment-structure.xml" file with a "schemaLocation" attribute (just for the sake of perfection - if a xml file has xsd, it should point to it ;-).

       

      This works fine in Eclipse (no validation errors), but it will fail when deployed to a WildFly 8.2 server.

       

      This is the file:

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="urn:jboss:deployment-structure:1.1 http://www.jboss.org/schema/jbossas/jboss-deployment-structure-1_1.xsd">

          <deployment>

              <dependencies>

                  <system export="true">

                      <paths>

                          <path name="com/sun/java/swing/plaf/windows" />

                      </paths>

                  </system>

              </dependencies>

          </deployment>

      </jboss-deployment-structure>

       

       

      And this is the parse exception:

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,129]

      Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:deployment-structure:1.1}jboss-deployment-structure', text is: 'null'

          at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.unexpectedContent(JBossDeploymentStructureParser11.java:1129) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:211) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:69) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)

          at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)

          at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:316) [wildfly-server-8.2.0.Final.jar:8.2.0.Final]

          ... 8 more

       

      It works with this file header:

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">

       

      Fortunately, JBossTools adds schema validation, because the namespace is added to the xsd catalog. So this schemaLocation is not required to be able to validate the file.

       

      Do you think this is worth a bug report? Or is it a misunderstanding of mine?

       

      Best regards

       

      Wolfgang