Issue
Suddenly all the Pipeline builds that use Maven Integration fail with errors that look like:
java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:83) at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution2$WithMavenStepExecutionCallBack.finished(WithMavenStepExecution2.java:1108) at org.jenkinsci.plugins.pipeline.maven.fix.jenkins49337.GeneralNonBlockingStepExecution$TailCall.lambda$onSuccess$0(GeneralNonBlockingStepExecution.java:142)
Caused: javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:311) at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267) at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:120) at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:74)
Environment
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Managed controller
-
CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
-
CloudBees CI (CloudBees Core) on traditional platforms - Client controller
-
CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
-
CloudBees Jenkins Enterprise - Managed controller
-
CloudBees Jenkins Enterprise - Operations center
Resolution
Locate and uninstall the plugin that loads the outdated implementation of the Java API for XML Processing (JAXP), e.g., Xerces 2.6.
Known plugins that cause the issue:
-
Discard Old Build. No fix available. The plugin has not been updated for six years.
-
Fortify 360. This plugin is not maintained and not supported by the original maintainer. Please use Fortify plugin instead.
If neither of the plugins is installed you can either:
-
Search through the open file descriptors to locate all the
xercesImpl-*.jar
files. If you see any with version 2.6.x, they are most likely the cause. The plugin id is the part of the path right after theplugins
directory./tmp/jenkins/plugins/fortify360/WEB-INF/lib/xercesImpl-2.6.2.jar /tmp/jenkins/plugins/build-pipeline-plugin/WEB-INF/lib/xercesImpl-2.9.1.jar /tmp/jenkins/plugins/pipeline-aws/WEB-INF/lib/xercesImpl-2.12.0.jar
-
Use What Plugin is providing this class? to locate plugins loading the
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
class.Looking for: org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.class Found in Plugin:pipeline-aws jar:file:/tmp/jenkins/plugins/pipeline-aws/WEB-INF/lib/xercesImpl-2.12.0.jar!/org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.class Found in Plugin:discard-old-build jar:file:/tmp/jenkins/plugins/discard-old-build/WEB-INF/lib/xercesImpl-2.6.2.jar!/org/apache/xerces/jaxp/DocumentBuilderFactoryImpl.class
If you are a CloudBees customer and having doubts or issues with the above, please generate a support bundle and open a support ticket.