Uploaded image for project: 'JBoss Metadata'
  1. JBoss Metadata
  2. JBMETA-363

Validation errors with "jboss-web_7_0.xsd

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 12.0.0.Final
    • 7.0.5.Final, 8.1.2.Final
    • web
    • None

    Description

      I tried to create a "jboss-web.xml" file based on the "jboss-web_7_1.xsd"

      As this is not uploaded to the web up to now, I created it with a schema location pointing to my local JBoss 7.2.0Alpha1 snapshot:

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web 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 file:///C:/Temp/jboss-as-7.2.0.Alpha1-SNAPSHOT/docs/schema/jboss-web_7_0.xsd"
      version="7.0">
      ...

      </jboss-web>

      Eclipse shows validation errors in the XSD file.

      The first on is:
      sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two
      occurences of 'http://java.sun.com/xml/ns/javaee,descriptionGroup'
      (occurs in javaee_6.xsd, line 88)
      And a lot more of those.

      The file was created as part of https://issues.jboss.org/browse/AS7-1262 - and the one who created it found the same validation error.

      It seems the fix is quite simple:
      "jboss-web_7_0.xsd" contains this import:

      <xsd:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="web-app_3_0.xsd"/>

      Change it to:
      <xsd:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"/>

      The reason seems to be: "jboss-web_7_0.xsd" imports "jboss-common_6-0.xsd", and this one imports "javaee_6.xsd" with a full schema location.
      The "web-app_3_0.xsd" in "jboss-web_7_0.xsd" has a local schema location, thus the "javaee_6.xsd" import in "web-app_3_0.xsd" points also to local.
      And this seems to cause a duplicate import of the file.

      (might also be an Eclipse valiation bug)

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-jclere Jean-Frederic Clere
              wolfgangknauf Wolfgang Knauf
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: