JDK-8316383 : NullPointerException in AbstractSAXParser after JDK-8306632
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 22
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2023-09-15
  • Updated: 2024-02-14
  • Resolved: 2023-09-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b17Fixed
Related Reports
Relates :  
Description
The following example crashes with a NullPointerException in the latest builds of JDK 22. I think the culprit is JDK-8306632:

```
class T {
  public static void main(String[] args) throws Exception {
    var reader = XMLReaderFactory.createXMLReader();
    reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
  }
}
```

```
$ java -fullversion
openjdk full version "22-ea+15-1134"
$ java T
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "jdk.xml.internal.XMLSecurityManager.setLimit(String, jdk.xml.internal.JdkProperty$State, Object)" because "this.securityManager" is null
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setFeature(AbstractSAXParser.java:1674)
        at T.main(T.java:5)
```
Comments
Changeset: 4e571775 Author: Joe Wang <joehw@openjdk.org> Date: 2023-09-21 19:17:24 +0000 URL: https://git.openjdk.org/jdk/commit/4e5717754ab3009c75869bf9f228820adb86dd98
21-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/15828 Date: 2023-09-19 21:10:41 +0000
19-09-2023