4 Replies Latest reply on Jan 28, 2009 2:50 PM by Wolfgang Knauf

    Problems with jboss-5.0.xsd

    Wolfgang Knauf Master

      Hi all,

      the jboss-5.0.xsd from "docs\schema" of JBoss 5.0GA (and from the linked bug) seems to contain some problems.

      a) the comment from "jboss-5.0.xsd" showing a sample file seems to be wrong, as this jboss.xml leads to an error:

       <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.jboss.org/j2ee/schema
       http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
       version="5.0">
       ...
       </jboss>
      

      The deployment error is:
      ...
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Element {http://www.jboss.com/xml/ns/javaee}jboss is not bound as a global element.
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:203)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:168)



      I found that this is working (validation in eclipse and deployment to JBoss):
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss xmlns="http://www.jboss.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss_5_0.xsd"
       version="5.0">
       ....
      </jboss>
      


      b) Eclipse/WTP complains about a version number "5.0" and claims that the xsd allows only "3.0" (but no error on deploy). I had to add my local file to the XML catalog, as the internet version is outdated and does not contain the parameters for https://jira.jboss.org/jira/browse/JBAS-6013)

      c) Eclipse/WTP complains about this:
      "Failed to read the schema document 'ejb-jar_3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>"
      So I tried to fix this by changing the schema import to
      <xsd:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"/>

      This raised more errors:
      "Expecting namespace 'http://www.jboss.com/xml/ns/javaee', but the target namespace of the schema document is 'http://java.sun.com/xml/ns/javaee'"

      Now I am confused, as I am not a XSD pro :-(.

      Wolfgang