SAXParserImpl: Property is not recognized error using JVM 7 update 40 or later

Solution Unverified - Updated -

Environment

  • Red Hat JBoss Operations Network (ON) 3.1.2
    • Starting the JBoss ON server
  • Red Hat JBoss A-MQ 6.2.0
    • Starting the Karaf container
  • Oracle or OpenJDK Java Runtime Environment (JRE) 1.7.0_40 - 1. 7.0_79, 1.8.0_45

Issue

  • SAXParserImpl Property is not recognized. Server logs contain the following errors during startup:

    ERROR [STDERR] Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
    ERROR [STDERR] Compiler warnings:
    ERROR [STDERR]   WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
    
  • What is the impact of the SAXParserImpl: Property is not recognized error?

    • Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized
    • Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized
  • When using a particular blueprint XML, dropped in the 'deploy' directory, and bin/karaf is executed afterwards, the following warnings are shown on the console:

bash-4.1$ ./karaf
Please wait, JBoss A-MQ is initializing...
 71% [===================================================>                    ]Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
 77% [=======================================================>                ]Compiler warnings:
  WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
100% [========================================================================]

Resolution

The messages can be ignored.
There is an upstream xerces JIRA to Add support for properties set by JAXP in the JDK (secure-processing, accessExternalDTD and entityExpansionLimit)

JBoss ON
Alternatively, upgrading to JBoss ON 3.2 will resolve the issue. If you can not upgrade and would like to prevent the messages from being displayed, you will need to downgrade the JBoss ON 3.1.2 server's JVM to 7 update 25 (1.7.0_25). This is not recommended.

Root Cause

This issue was originally identified in Oracle JDK-8016153. It has also been confirmed in OpenJDK JDK-8016153.

The warnings are a result of the Xerces library included in the container not supporting the accessExternalDTD or entityExpansionLimit properties. In JVM versions prior to 1.7.0_40 the failure would result in an exception being thrown and ignored. However, a change was made to how unsupported properties were handled, resulting in a warning being written to the standard error file descriptor. The logging system captures this output and displays it in the server log as an ERROR.

In JRE 7 update 40 (1.7.0_40) the error message was limited to the following:

ERROR [STDERR] Compiler warnings:
ERROR [STDERR]   WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'

However, JRE 7 update 45 (1.7.0_45) included the addition error:

ERROR [STDERR] Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

When running JBoss ON with JRE 7 update 25 (1.7.0_25) none of above error messages are logged.

Diagnostic Steps

JBoss ON

  • Review the server log at start time for the info and error messages similar to the following:

    INFO  [com.arjuna.ats.jbossatx.jta.TransactionManagerService] Recovery manager started
    INFO  [com.arjuna.ats.jbossatx.jta.TransactionManagerService] Binding TransactionManager JNDI Reference
    INFO  [org.jboss.ejb3.EJB3Deployer] Starting java:comp multiplexer
    ERROR [STDERR] Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
    ERROR [STDERR] Compiler warnings:
    ERROR [STDERR]   WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
    INFO  [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib64:/lib64:/lib:/usr/lib
    INFO  [org.apache.coyote.http11.Http11Protocol] Initializing Coyote HTTP/1.1 on http-192.168.1.1-7080
    INFO  [org.apache.coyote.http11.Http11Protocol] Initializing Coyote HTTP/1.1 on http-192.168.1.1-7443
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments