JDK-8222122 : Provision to disable XML validation in .jfc file in JFR
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-04-08
  • Updated: 2021-10-16
  • Resolved: 2019-12-19
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 8
8u251 b01Fixed
Description
Problem Statement :

Application throw exception when it is using oracle.xml.jaxp.JXSAXParserFactory parser.

Command : 
cmd $PID JFR.start name=MyRecording dumponexit=true filename=/tmp/JFR_recording.jfr duration=600s settings=profile

Exception: 
Could not start recording. Unexpected error occured when loading setting profile from JRE_HOME/lib/jfr. UnsupportedOperationException: This parser does not support specification “null” version “null”

Parser used : SAXParserFactory implementation oracle.xml.jaxp.JXSAXParserFactory

With -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl

JFR is able to launch but application started throwing exception ::

JAXBException occured while unmarshalling string to AV Message.unexpected element (uri:“”, local:“AVMessage”). Expected elements are <{http://xmlns.oracle.com/av/agent}AVMessage>

[com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:523)
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:199)
com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:194)


Requesting JFR team to introduce a way to disable validation of the .jfc file in a JDK 8 updates release, for example the system property -jfr.validate.jfc=false. 

Comments
Comment from the Assignee : Will not support old XML tags.
04-11-2019

What do you mean by that ?
04-11-2019

Requested information is not available from submitter
23-10-2019

JDK 9 (and later releases) uses the internal XML-parser located in java.base (also used by java.util.Properties), so they are not affected by applications that uses very old XML parsers. A potential workaround could be for customer tio upgrade to a more recent XML-parser, but not as recent as to cause other issues in their application.
08-04-2019