Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47710

ClassNotFoundException: org.w3c.dom.ElementTraversal in pipeline maven plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • pipeline-maven-plugin

      After upgrading a lot of plugins, and upgrading from jenkins 2.60.3 to 2.73.2, we started receiving the error below at the end of a pipeline job run

      This job was working fine previously. Not sure which plugin upgrade caused it to break, but the stacktrace indicates the pipeline-maven plugin.

      [jenkins-maven-event-spy] INFO generated /home/tomcat/jenkins/workspace/ild_hotfix-5.103.2-C3WMOGLRLRCDP2YYDQAMCJEDYSOSHAP64XTGW33DQE232WFXLS2Q@tmp/withMaven72f971a5/maven-spy-20171027-235746-896733511347818658990.log
      [Pipeline] }
      [Pipeline] End of Pipeline
      
      GitHub has been notified of this commit?s build result
      
      java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
      	at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
      	at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
      	at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      Caused: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      	at jenkins.util.AntClassLoader.defineClassFromData(AntClassLoader.java:1140)
      	at hudson.ClassicPluginStrategy$AntClassLoader2.defineClassFromData(ClassicPluginStrategy.java:844)
      	at jenkins.util.AntClassLoader.getClassFromStream(AntClassLoader.java:1311)
      	at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1364)
      	at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
      	at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)
      	at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)
      	at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)
      	at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
      	at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:95)
      	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WorkspaceCleanupCallback.finished(WithMavenStepExecution.java:876)
      	at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
      	at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
      	at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:166)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Finished: FAILURE
      

      When viewing the run page (e.g. job/foo/###), it appears the run has finished.
      But when viewing the jenkins root page, the run can still be seen running in the 'Build Executor Status' panel. So, it is clogging up our executors. Manual abort seems to clear it out.

      The pipeline uses the following:

      // ... snip...
      withMaven(jdk: 'xxx', maven: 'yyy') {
          //... snip ....
      	sh 'mvn -U clean deploy'
      }
      

            cleclerc Cyrille Le Clerc
            philster_jenkins Phil Clay
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: