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

Vague error message from JAXP SchemaFactory

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • 9
    • 6
    • xml

      When you run the following code,

              SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI)
                  .newSchema(new File("No such schema"));

      You get the following error:

      org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'file:///c:/kohsuke/Sun/jaxp/jaxp-sources/No such schema', 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>.

      This is embarassingly silly.

      - case 1,2 and case 3 are easily distinguishable. so please use two different error messages.

      - give us the nested exception that shows the underlying cause. That can tell me whether
        the resource was not found, or whether there was an IO error.

      - in case 3, please give us the name of the element you found.

            joehw Joe Wang
            kkawagucsunw Kohsuke Kawaguchi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: