Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6402288

Impossible to create javax.xml.validation.Schema instance from "web-app_2_4.xsd"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • 6
    • 5.0
    • xml

      When I try to create a javax.xml.validation.Schema instance off of the Servlet 2.4 deployment descriptor schema ("web-app_2_4.xsd"), I get the exception below.

      To reproduce, compile the attached SchemaTester.java, unzip the attached schemas.jar.zip, and invoke this command:

        % java -classpath schemas.jar:. SchemaTester

      I'm using jdk1.5.0_06.

      Here's the exception I'm getting:

      Exception in thread "main" org.xml.sax.SAXParseException: sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'http://java.sun.com/xml/ns/j2ee,descriptionGroup'.
              at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
              at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
              at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2241)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.checkForDuplicateNames(XSDHandler.java:1918)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.buildGlobalNameRegistries(XSDHandler.java:983)
              at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:478)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:556)
              at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:523)
              at com.sun.org.apache.xerces.internal.jaxp.validation.xs.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:206)
              at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:489)
              at SchemaTester.main(SchemaTester.java:19)

            nwalshsunw Norman Walsh (Inactive)
            jlueheorcl Jan Luehe (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: