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

ClassCast Exception when parsing JUnit surefire reports during website generation

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None
    • Linux 64-bit, jenkins 1.462, java 7, maven 3.0.4

      When generating a website with mvn clean site site:deploy, I will consistently get a ClassCastException when jenkins is trying to parse the junit surefire reports.
      This does not happen if I run the command from the command-line, and interestingly enough it doesn't happen for the non-site build (e.g. mvn clean deploy)

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running com.ften.creditpool.latency.ThroughputStatsTest
      Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.566 sec
      Running com.ften.creditpool.latency.ThroughputCreditPoolTest
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.015 sec
      Running com.ften.creditpool.latency.MinMaxAverageTest
      Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
      Running com.ften.creditpool.audit.AuditingCreditPoolTest
      Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.012 sec
      Running com.ften.creditpool.CreditPoolBeanTest
      Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 sec

      Results :

      Tests run: 29, Failures: 0, Errors: 0, Skipped: 0

      mojoSucceeded org.apache.maven.plugins:maven-surefire-plugin:2.12(default-test)
      [JENKINS] Recording test results
      hudson.util.IOException2: Failed to read /var/lib/jenkins/jobs/risk-alerts_site/workspace/credit-pool/target/surefire-reports/TEST-com.ften.creditpool.CreditPoolBeanTest.xml
      at hudson.tasks.junit.TestResult.parse(TestResult.java:244)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:163)
      at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:141)
      at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:421)
      at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:403)
      at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:87)
      at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:228)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:365)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeForkedExecutions(DefaultLifecycleExecutor.java:173)
      at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin(DefaultMavenReportExecutor.java:284)
      at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports(DefaultMavenReportExecutor.java:150)
      at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports(AbstractSiteRenderingMojo.java:247)
      at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:121)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
      at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
      at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:98)
      at hudson.maven.Maven3Builder.call(Maven3Builder.java:64)
      at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      at hudson.remoting.Request$2.run(Request.java:287)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
      Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
      at org.dom4j.io.SAXReader.read(SAXReader.java:484)
      at org.dom4j.io.SAXReader.read(SAXReader.java:264)
      at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:112)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:227)
      ... 44 more
      Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
      at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
      at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
      at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
      at org.dom4j.io.SAXReader.read(SAXReader.java:449)
      ... 47 more
      forkedProjectSucceeded com.ften.creditpool:credit-pool:0.0.2-SNAPSHOT

          [JENKINS-13709] ClassCast Exception when parsing JUnit surefire reports during website generation

          Ronoaldo Pereira added a comment - - edited

          I am still having this on Jenkins 1.505. The same error is happening on surefire reports:

          [INFO] --- maven-surefire-plugin:2.13:test (default-test) @ my-api ---
          [JENKINS] Recording test results
          hudson.util.IOException2: Failed to read /var/lib/tomcat6/data/jenkins/jobs/mailmarketing-api/workspace/target/surefire-reports/TEST-a.b.c.MyTest.xml
          	at hudson.tasks.junit.TestResult.parse(TestResult.java:284)
          	at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:223)
          	at hudson.tasks.junit.TestResult.parse(TestResult.java:192)
          	at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
          	at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:453)
          	at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:435)
          	at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:87)
          	at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
          	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:228)
          	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
          	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
          	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
          	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
          	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
          	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
          	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
          	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
          	at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
          	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:601)
          	at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
          	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
          	at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
          	at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          	at hudson.remoting.Request$2.run(Request.java:326)
          	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
          	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
          	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
          	at java.lang.Thread.run(Thread.java:722)
          Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
          	at org.dom4j.io.SAXReader.read(SAXReader.java:484)
          	at org.dom4j.io.SAXReader.read(SAXReader.java:264)
          	at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
          	at hudson.tasks.junit.TestResult.parse(TestResult.java:267)
          	... 35 more
          Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
          	at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
          	at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
          	at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
          	at org.dom4j.io.SAXReader.read(SAXReader.java:449)
          	... 38 more
          

          Ronoaldo Pereira added a comment - - edited I am still having this on Jenkins 1.505. The same error is happening on surefire reports: [INFO] --- maven-surefire-plugin:2.13:test ( default -test) @ my-api --- [JENKINS] Recording test results hudson.util.IOException2: Failed to read / var /lib/tomcat6/data/jenkins/jobs/mailmarketing-api/workspace/target/surefire-reports/TEST-a.b.c.MyTest.xml at hudson.tasks.junit.TestResult.parse(TestResult.java:284) at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:223) at hudson.tasks.junit.TestResult.parse(TestResult.java:192) at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148) at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:453) at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:435) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:87) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:228) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) at hudson.maven.Maven3Builder.call(Maven3Builder.java:100) at hudson.maven.Maven3Builder.call(Maven3Builder.java:66) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang. Thread .run( Thread .java:722) Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory at org.dom4j.io.SAXReader.read(SAXReader.java:484) at org.dom4j.io.SAXReader.read(SAXReader.java:264) at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129) at hudson.tasks.junit.TestResult.parse(TestResult.java:267) ... 35 more Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97) at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645) at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969) at org.dom4j.io.SAXReader.read(SAXReader.java:449) ... 38 more

          I'm experiencing this too on Windows XP slave, Windows 2008 sp2 server, java 7, maven 3.0.4

          Similar stack trace:
          hudson.util.IOException2: Failed to read <redacted-file-path>\target\surefire-reports\TEST-<redacted-testclass-name>.xml
          at hudson.tasks.junit.TestResult.parse(TestResult.java:284)
          at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:223)
          at hudson.tasks.junit.TestResult.parse(TestResult.java:192)
          at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148)
          at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:453)
          at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:435)
          at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:87)
          at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:228)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
          at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:365)
          at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeForkedExecutions(DefaultLifecycleExecutor.java:173)
          at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin(DefaultMavenReportExecutor.java:273)
          at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports(DefaultMavenReportExecutor.java:154)
          at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports(AbstractSiteRenderingMojo.java:235)
          at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:121)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
          at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
          at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
          at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
          at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
          at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
          at java.lang.Thread.run(Thread.java:662)
          Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
          at org.dom4j.io.SAXReader.read(SAXReader.java:484)
          at org.dom4j.io.SAXReader.read(SAXReader.java:264)
          at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
          at hudson.tasks.junit.TestResult.parse(TestResult.java:267)
          ... 45 more
          Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
          at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97)
          at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645)
          at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969)
          at org.dom4j.io.SAXReader.read(SAXReader.java:449)
          ... 48 more

          Brett Delle Grazie added a comment - I'm experiencing this too on Windows XP slave, Windows 2008 sp2 server, java 7, maven 3.0.4 Similar stack trace: hudson.util.IOException2: Failed to read <redacted-file-path>\target\surefire-reports\TEST-<redacted-testclass-name>.xml at hudson.tasks.junit.TestResult.parse(TestResult.java:284) at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:223) at hudson.tasks.junit.TestResult.parse(TestResult.java:192) at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148) at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:453) at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:435) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:87) at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:42) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:228) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.MojoExecutor.executeForkedExecutions(MojoExecutor.java:365) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeForkedExecutions(DefaultLifecycleExecutor.java:173) at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildReportPlugin(DefaultMavenReportExecutor.java:273) at org.apache.maven.reporting.exec.DefaultMavenReportExecutor.buildMavenReports(DefaultMavenReportExecutor.java:154) at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getReports(AbstractSiteRenderingMojo.java:235) at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:121) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158) at hudson.maven.Maven3Builder.call(Maven3Builder.java:100) at hudson.maven.Maven3Builder.call(Maven3Builder.java:66) at hudson.remoting.UserRequest.perform(UserRequest.java:118) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:326) at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:662) Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory at org.dom4j.io.SAXReader.read(SAXReader.java:484) at org.dom4j.io.SAXReader.read(SAXReader.java:264) at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129) at hudson.tasks.junit.TestResult.parse(TestResult.java:267) ... 45 more Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory at org.dom4j.DocumentFactory.getInstance(DocumentFactory.java:97) at org.dom4j.io.SAXReader.getDocumentFactory(SAXReader.java:645) at org.dom4j.io.SAXReader.createContentHandler(SAXReader.java:969) at org.dom4j.io.SAXReader.read(SAXReader.java:449) ... 48 more

          Andreas Horst added a comment -

          I can confirm this on 1.528; same stack trace and only in site lifecycle builds...

          Andreas Horst added a comment - I can confirm this on 1.528; same stack trace and only in site lifecycle builds...

          When my projet is build with "clean compile package deploy site jacoco:report"(1), it works fine, but with "clean site jacoco:report"(2) if fails.

          (1): http://jrds.fr/jenkins/job/rrd4j/132/consoleText
          (2): http://jrds.fr/jenkins/job/rrd4j/131/consoleText

          Fabrice Bacchella added a comment - When my projet is build with "clean compile package deploy site jacoco:report"(1), it works fine, but with "clean site jacoco:report"(2) if fails. (1): http://jrds.fr/jenkins/job/rrd4j/132/consoleText (2): http://jrds.fr/jenkins/job/rrd4j/131/consoleText

          Still no assignee ?

          Fabrice Bacchella added a comment - Still no assignee ?

          Same message, should be probably linked.

          Fabrice Bacchella added a comment - Same message, should be probably linked.

          I have committed a fix that fixed it for me: Pull request has not been merged yet: https://github.com/jenkinsci/dom4j/pull/4

          As far as I am concerned, it seems that the bug is usually occurring if the build is using some maven plugins that have a different context class loader and use dom4j first (before surefire tries). Dom4j initializes the the instance using different class loader, and later when trying to cast to an instance loaded by different class loader you get the exception.

          Rafal Nowosielski added a comment - I have committed a fix that fixed it for me: Pull request has not been merged yet: https://github.com/jenkinsci/dom4j/pull/4 As far as I am concerned, it seems that the bug is usually occurring if the build is using some maven plugins that have a different context class loader and use dom4j first (before surefire tries). Dom4j initializes the the instance using different class loader, and later when trying to cast to an instance loaded by different class loader you get the exception.

          Andreas Horst added a comment -

          I can still confirm this on 1.574 with maven-site-plugin 3.3. Also the workaround to additionally invoke the default lifecycle (e.g. "clean package site-deploy") works. Though it would be nice to be able to just do a "clean site-deploy" in a dedicated site job.

          Andreas Horst added a comment - I can still confirm this on 1.574 with maven-site-plugin 3.3. Also the workaround to additionally invoke the default lifecycle (e.g. "clean package site-deploy") works. Though it would be nice to be able to just do a "clean site-deploy" in a dedicated site job.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/57d6166f9b9149d5411a0f39f17f5f56a812732d
          Log:
          [FIXED JENKINS-13709]

          Integrating dom4j with the fix for java.lang.ClassCastException:
          org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

          See: https://github.com/stapler/stapler/pull/36

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/pom.xml http://jenkins-ci.org/commit/jenkins/57d6166f9b9149d5411a0f39f17f5f56a812732d Log: [FIXED JENKINS-13709] Integrating dom4j with the fix for java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory See: https://github.com/stapler/stapler/pull/36

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/6d298b0a4950c4a1507a0b17bc5071fe25cf4e09
          Log:
          [FIXED JENKINS-13709]

          Integrated new dom4j

          Compare: https://github.com/jenkinsci/jenkins/compare/a2341e6b4c85...6d298b0a4950

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/6d298b0a4950c4a1507a0b17bc5071fe25cf4e09 Log: [FIXED JENKINS-13709] Integrated new dom4j Compare: https://github.com/jenkinsci/jenkins/compare/a2341e6b4c85...6d298b0a4950

          I've merged the proposed fix in dom4j as requested. The fix is targeted to 1.577.

          I don't have time to deep dive into this right now, so I could be wrong, but the fix in dom4j appears to me like a bandaid to hide the real problem. The stated error is that a class fails to cast to the class of the same name, which indicates some kind of classloader mess up. If that is the case, the real fix would have to be to fix the classloader mess up, and not where the service lookup happens.

          Kohsuke Kawaguchi added a comment - I've merged the proposed fix in dom4j as requested. The fix is targeted to 1.577. I don't have time to deep dive into this right now, so I could be wrong, but the fix in dom4j appears to me like a bandaid to hide the real problem. The stated error is that a class fails to cast to the class of the same name, which indicates some kind of classloader mess up. If that is the case, the real fix would have to be to fix the classloader mess up, and not where the service lookup happens.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3624
          [FIXED JENKINS-13709] (Revision 57d6166f9b9149d5411a0f39f17f5f56a812732d)
          [FIXED JENKINS-13709] (Revision 6d298b0a4950c4a1507a0b17bc5071fe25cf4e09)

          Result = SUCCESS
          kohsuke : 57d6166f9b9149d5411a0f39f17f5f56a812732d
          Files :

          • core/pom.xml

          kohsuke : 6d298b0a4950c4a1507a0b17bc5071fe25cf4e09
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #3624 [FIXED JENKINS-13709] (Revision 57d6166f9b9149d5411a0f39f17f5f56a812732d) [FIXED JENKINS-13709] (Revision 6d298b0a4950c4a1507a0b17bc5071fe25cf4e09) Result = SUCCESS kohsuke : 57d6166f9b9149d5411a0f39f17f5f56a812732d Files : core/pom.xml kohsuke : 6d298b0a4950c4a1507a0b17bc5071fe25cf4e09 Files : changelog.html

          Juan Sotuyo added a comment -

          I am coming across this issue using Jenkins 1.580.2; which effectively uses dom4j-1.6.1-jenkins-4.jar

          Following Andreas Horts' advice, and running `mvn package site` worked; still I'd rather the build just worked regardless of the targets.

          Juan Sotuyo added a comment - I am coming across this issue using Jenkins 1.580.2; which effectively uses dom4j-1.6.1-jenkins-4.jar Following Andreas Horts' advice, and running `mvn package site` worked; still I'd rather the build just worked regardless of the targets.

          Jesse Glick added a comment -

          This is neither a problem in dom4j nor a bug in the junit plugin. It is a fundamental design flaw in maven-plugin. If you encounter issues like this, simply run mvn as an external process.

          Jesse Glick added a comment - This is neither a problem in dom4j nor a bug in the junit plugin. It is a fundamental design flaw in maven-plugin . If you encounter issues like this, simply run mvn as an external process.

            Unassigned Unassigned
            scooper4711 scooper4711
            Votes:
            13 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: