Legacy Knowledge Base
Published Sep. 10, 2025

Avoiding SAXParser Exceptions

Written By

Christopher Lui

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

By default, the Liferay platform does not define a SAXParser. But please note that a SAXParser contains the logic that can parse XML files.

Liferay does not define a SAXParser because certain setups (e.g. Weblogic) may already have a SAXParser; trying to override them with Liferay's own may cause serious issues. However, application servers, such as Tomcat, do not have their own SAXParser. So when working with Documents & Media, with S3Store and Liferay DXP 7.0 and 7.1, you will receive errors such as the following:

ERROR [http-nio-10080-exec-1][PortletServlet:109] javax.portlet.PortletException: com.amazonaws.AmazonClientException: Couldn't initialize a SAX driver to create an XMLReader
javax.portlet.PortletException: com.amazonaws.AmazonClientException: Couldn't initialize a SAX driver to create an XMLReader

org.xml.sax.SAXException: Can't create default XMLReader; is system property org.xml.sax.driver set? This error indicates that an XMLReader has not been defined.

Caused by: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found_java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser cannot be found by com.liferay.journal.web_1.4.0 [Sanitized]
       at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
       at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
       at com.amazonaws.services.s3.model.transform.XmlResponsesSaxParser.<init>(XmlResponsesSaxParser.java:114)
       ... 229 more

Resolution

To resolve this issue, a SAXParser must be defined manually.

You can easily do this by setting one in a system-ext.properties file by executing the following steps:

  1. Create a system-ext.properties file
  2. Add in org.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser
  3. Place system-ext.properties into /webapps/$LIFERAY_WAR/WEB-INF/classes
  4. Restart your DXP platform. 

You should see the system-ext.properties load up in the starting logs, and you should not receive any SAXParser errors while working with S3Store.

Did this article resolve your issue ?

Legacy Knowledge Base