Pipeline Maven Integration fails due to java.lang.AbstractMethodError

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

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:

  1. 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 the plugins 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
    
  2. 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.

References

[JENKINS-47486] FactoryConfigurationError: Provider for class javax.xml.parsers.DocumentBuilderFactory cannot be created (was “Exceptions after running goals”)
[JENKINS-57833] All builds with maven pipeline plugin fail with java.lang.AbstractMethodError while parsing event spy log

Have more questions?

0 Comments

Please sign in to leave a comment.