United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8016153 Property http://javax.xml.XMLConstants/property/accessExternalDTD is not recognized.
JDK-8016153 : Property http://javax.xml.XMLConstants/property/accessExternalDTD is not recognized.

Details
Type:
Bug
Submit Date:
2013-06-07
Status:
Resolved
Updated Date:
2013-12-16
Project Name:
JDK
Resolved Date:
2013-06-10
Component:
xml
OS:
Sub-Component:
jaxp
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u40,8
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Duplicate:

Sub Tasks

Description
While running the jaxp XSLTC tests against a recent jdk 8 I noticed that tests failed - due to the following root exception being thrown:

org.xml.sax.SAXNotRecognizedException: Property
"http://javax.xml.XMLConstants/property/accessExternalDTD"
is not recognized.
    at org.apache.xerces.parsers.AbstractSAXParser.setProperty(Unknown
Source)
    at org.apache.xerces.jaxp.SAXParserImpl.setProperty(Unknown Source)
    at
com.sun.org.apache.xalan.internal.xsltc.compiler.Parser.parse(Parser.java:479) 

The code that throws this exception - in Parser.java - is at line 479 below:

478         final SAXParser parser = factory.newSAXParser();
479                parser.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD,
480                           _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD));

This means that application which have a third party JAXP 1.4 implementation in their classpath could potentially encounter a similar problem - if the implementation doesn't recognize the property being set.



                                    

Comments
I see the same issue with jdk7u-dev.
                                     
2013-06-07
URL:   http://hg.openjdk.java.net/jdk8/tl/jaxp/rev/5c84d4a878f1
User:  joehw
Date:  2013-06-10 21:44:14 +0000

                                     
2013-06-10
Run the test with Xerces jars on the bootclasspath:
java -classpath . -Xbootclasspath/p:./xercesImpl.jar:./xml-apis.jar PluginParser

Expected warnings instead of RuntimeException:
Warning:  org.apache.xerces.parsers.SAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
Compiler warnings:
  WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
<?xml version="1.0" encoding="UTF-8"?>test passed

Number of tests passed: 1
Number of tests failed: 0

                                     
2013-06-11
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jaxp/rev/5c84d4a878f1
User:  lana
Date:  2013-06-24 21:36:14 +0000

                                     
2013-06-24



Hardware and Software, Engineered to Work Together