[jboss-jira] [JBoss JIRA] (WFLY-943) XML schema; use of elementFormDefault='unqualified'; cannot validate some documents

Wolfgang Knauf (JIRA) jira-events at lists.jboss.org
Mon May 6 15:39:53 EDT 2013


    [ https://issues.jboss.org/browse/WFLY-943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772455#comment-12772455 ] 

Wolfgang Knauf commented on WFLY-943:
-------------------------------------

It seems to validate if you remove all "p:" declarations beside the one at the root element:


<?xml version="1.0" encoding="UTF-8"?>
<p:jboss-deployment-structure xmlns:p="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>
      <module-alias name="bar"/>
      <dependencies>
         <module name="foo" />
      </dependencies>
   </deployment>
</p:jboss-deployment-structure>


But the next problem is that this file (with the schemaLocation) will not deploy (same error also for WildFly):
...
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from C:\Temp\jboss-as-7.2.0.Alpha1-SNAPSHOT\standalone\deployments\MyGreat.ear\META-INF\jboss-deployment-structure.xml
	at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:322) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.parse(DeploymentStructureDescriptorParser.java:294) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:158) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
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:1119) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:210) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	at org.jboss.as.server.deployment.module.descriptor.JBossDeploymentStructureParser11.readElement(JBossDeploymentStructureParser11.java:68) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	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) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
	... 8 more

21:34:40,692 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "KuchenSimple.ear" was rolled back with the following failure message: 
{"JBAS014671: Failed services" => {"jboss.deployment.unit.\"MyGreat.ear\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MyGreat.ear\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"MyGreat.ear\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018748: Error loading jboss-deployment-structure.xml from C:\\Temp\\jboss-as-7.2.0.Alpha1-SNAPSHOT\\standalone\\deployments\\MyGreat.ear\\META-INF\\jboss-deployment-structure.xml
    Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: JBAS018754: Unexpected content of type 'element start', name is '{urn:jboss:deployment-structure:1.1}jboss-deployment-structure', text is: 'null'"}}

                
> XML schema; use of elementFormDefault='unqualified'; cannot validate some documents
> -----------------------------------------------------------------------------------
>
>                 Key: WFLY-943
>                 URL: https://issues.jboss.org/browse/WFLY-943
>             Project: WildFly
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Elias Ross
>         Attachments: jboss-deployment-structure.xml
>
>
> When attempting to write a (seemingly) valid jboss-deployment-structure.xml using the schema in ./docs, my document fails to validate.
> This is because of the settings used in the XSD. Have these XSDs been used to validate actual documents? By setting unqualified to 'qualified' then the documents will probably validate.
> $ git grep elementFormDefault..unqualified
> jboss-deployment-dependencies-1_0.xsd:            elementFormDefault="unqualified"
> jboss-deployment-structure-1_0.xsd:            elementFormDefault="unqualified"
> jboss-deployment-structure-1_1.xsd:            elementFormDefault="unqualified"
> jboss-deployment-structure-1_2.xsd:            elementFormDefault="unqualified"
> jboss-ejb-client_1_0.xsd:            elementFormDefault="unqualified"
> jboss-ejb-client_1_1.xsd:            elementFormDefault="unqualified"
> jboss-ejb-client_1_2.xsd:            elementFormDefault="unqualified"
> jboss-jpa_1_0.xsd:  elementFormDefault="unqualified" 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list