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

SchemaFactory does not work according to javadoc and specification

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 5.0u12
    • Fix Version/s: None
    • Component/s: xml
    • Labels:

      Description

      > As per the specification


      >
      http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String),

      >

      >

      > jdk should find and load schema factory in the following order/preference


      >

      > 1. From the system property


      > "javax.xml.validation.SchemaFactory:schemaLanguage" and retuns if


      > successfully loaded


      >

      > 2. From $java.home/lib/jaxp.properties and returns if successfully loaded


      >

      > 3. From META-INF/services from loaded jar's and the first service


      > provider


      > found in class loader order that supports the specified schema is


      > returned


      >

      > 4. Platform default SchemaFactory


      >

      > Sun JDK reads the JAR META-INF service property for option (3) only as


      > <schemalanguage>=<provider-factory> but that is not the format as JAR


      > specification for service provider talks about. It should read the


      > property


      > file as <provider-factory> format. Please refer to


      >
      http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newInstance(java.lang.String)

      >

      >

      > and


      > http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider


      >

      >

      > Here is a simple standalone app (see attached


      > SunJDK-schema validation.zip). It has


      >

      > 1. SchemaTest.java which just try to get an instance of SchemaFactory


      >

      > 2. foo-sp.jar which has


      > META-INF/services/javax.xml.validation.SchemaFactory


      > as <provider-factory> format content


      >

      > 3. foo-sl-sp.jar which has


      > META-INF/services/javax.xml.validation.SchemaFactory as


      > <schemalanguage>=<provider-factory> format content


      >

      > 4. Scenarios-and-Results-SunJDK.rtf contains some scenarios tested


      > against on Sun JDK 1.5.0_11


      >

      BEA believes that IBM and Apache do not require the properties file to be of the
      form schemalanguage=parser-class as in the specification.

        Attachments

          Activity

            People

            • Assignee:
              nwalshsunw Norman Walsh (Inactive)
              Reporter:
              sbharadwsunw Srinivas Bharadwaj (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: