java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

Article ID:360034588971
1 minute readKnowledge base

Issue

I can see java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser errors in the logs and some plugin or functionality is not working on Jenkins.

Evidence

You are seeing a combination of the code below in your logs:

Caused: org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

This means something changed the SAX driver, so any plugin that should use XML parsing could stop working correctly.

Workaround

A possible workaround to try solving this issue is adding the Java argument:

-Dorg.xml.sax.driver=com.sun.org.apache.xerces.internal.parsers.SAXParser

Tested product/plugin versions

Jenkins LTS 2.89.x

This issue should not be dependent of any Jenkins version though.

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.