• Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • junit-plugin
    • None
    • Hudson version 1.377
      Windows Server 2008

      I'm getting a ClassCastException when Hudson tries to parse a JUnit test result. I'd prefer if the build just went through .

      Attaching the file that Hudson failed to parse, exception follows:

      org.apache.maven.lifecycle.LifecycleExecutionException: Unable to execute mojo
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      	at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExecutorInterceptor.java:65)
      	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      	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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      	at hudson.maven.agent.Main.launch(Main.java:165)
      	at hudson.maven.MavenBuilder.call(MavenBuilder.java:165)
      	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:681)
      	at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:625)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:114)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:270)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	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:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:619)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to execute mojo
      	at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo(MojoExecutor.java:106)
      	at com.atlassian.maven.plugins.amps.MavenGoals.runUnitTests(MavenGoals.java:199)
      	at com.atlassian.maven.plugins.amps.UnitTestMojo.execute(UnitTestMojo.java:15)
      	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      	at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:182)
      	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      	... 28 more
      Caused by: org.apache.maven.plugin.PluginManagerException: Failed to read d:\hudson\jobs\confluencemacro-plugin\workspace\enginfra\main\confluencemacro-plugin\target\surefire-reports\TEST-com.oracle.jrockit.confluence.plugins.GateKeeperMacroTest.xml
      	at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:196)
      	at org.twdata.maven.mojoexecutor.MojoExecutor.executeMojo(MojoExecutor.java:104)
      	... 33 more
      Caused by: hudson.util.IOException2: Failed to read d:\hudson\jobs\confluencemacro-plugin\workspace\enginfra\main\confluencemacro-plugin\target\surefire-reports\TEST-com.oracle.jrockit.confluence.plugins.GateKeeperMacroTest.xml
      	at hudson.tasks.junit.TestResult.parse(TestResult.java:208)
      	at hudson.tasks.junit.TestResult.parse(TestResult.java:149)
      	at hudson.tasks.junit.TestResult.<init>(TestResult.java:112)
      	at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:106)
      	at hudson.maven.MavenModuleSetBuild$Builder.postExecute(MavenModuleSetBuild.java:759)
      	at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:300)
      	at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170)
      	at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183)
      	... 34 more
      Caused by: org.dom4j.DocumentException: org.dom4j.DocumentFactory Nested exception: 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:99)
      	at hudson.tasks.junit.TestResult.parse(TestResult.java:193)
      	... 41 more
      Caused by: java.lang.ClassCastException: 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)
      	... 44 more
      

          [JENKINS-7666] ClassCastException parsing JUnit result

          whermeling added a comment -

          I can confirm this for other environment too. We use Linux and Hudson 1.384. The issue seems to have something to do with jobs building jira/confluence plugins.

          Probably something with classloading?

          whermeling added a comment - I can confirm this for other environment too. We use Linux and Hudson 1.384. The issue seems to have something to do with jobs building jira/confluence plugins. Probably something with classloading?

          farshidce added a comment -

          tried this xml file on the latest version jenkins 1.396 and didnt see an exception.

          does it make sense to close this bug as its not reproducible in the current release ?

          Started by user anonymous
          Recording test results
          Test reports were found but none of them are new. Did tests run?
          For example, /space/jenkins/testng-plugin-plugin/./work/jobs/junit/workspace/abc.xml is 6 min 36 sec old

          farshidce added a comment - tried this xml file on the latest version jenkins 1.396 and didnt see an exception. does it make sense to close this bug as its not reproducible in the current release ? Started by user anonymous Recording test results Test reports were found but none of them are new. Did tests run? For example, /space/jenkins/testng-plugin-plugin/./work/jobs/junit/workspace/abc.xml is 6 min 36 sec old

          Leonid Maslov added a comment -

          The same here

          Ubuntu, Hudson ver. 1.377

          Leonid Maslov added a comment - The same here Ubuntu, Hudson ver. 1.377

          Leonid Maslov added a comment -

          Any comments?
          Could someone acknowledge that is still happening / NOT happening with Jenkins version >= 1.377?

          Leonid Maslov added a comment - Any comments? Could someone acknowledge that is still happening / NOT happening with Jenkins version >= 1.377?

          kutzi added a comment -

          No response from reporter -> Cannot Reproduce

          kutzi added a comment - No response from reporter -> Cannot Reproduce

          Falko Modler added a comment -

          Today this problem occured in our site build. Jenkins version is: 1.471

          See also (and the comments as well):
          http://www.beyondlinux.com/2011/04/20/running-sonar-in-jenkinshudson-org-dom4j-documentfactory-cannot-be-cast-to-org-dom4j-documentfactory/

          Btw: We do not use sonar! So it seems it is not limited to sonar...

          Falko Modler added a comment - Today this problem occured in our site build. Jenkins version is: 1.471 See also (and the comments as well): http://www.beyondlinux.com/2011/04/20/running-sonar-in-jenkinshudson-org-dom4j-documentfactory-cannot-be-cast-to-org-dom4j-documentfactory/ Btw: We do not use sonar! So it seems it is not limited to sonar...

          Falko Modler added a comment -

          I tried patching Jenkins 1.471 as described in the blog article which did solve the DocumentFactory ClassCastException but another ClassCastException occured:

          java.lang.reflect.InvocationTargetException
          	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: java.lang.ExceptionInInitializerError
          	at edu.umd.cs.findbugs.DetectorFactoryCollection.getCoreResource(DetectorFactoryCollection.java:360)
          	at edu.umd.cs.findbugs.SystemProperties.loadPropertiesFromConfigFile(SystemProperties.java:72)
          	at edu.umd.cs.findbugs.SystemProperties.<clinit>(SystemProperties.java:55)
          	at edu.umd.cs.findbugs.SortedBugCollection.<clinit>(SortedBugCollection.java:185)
          	at hudson.plugins.findbugs.parser.FindBugsParser.readXml(FindBugsParser.java:262)
          	at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:206)
          	at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:143)
          	at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:103)
          	at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:358)
          	at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:317)
          	at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:266)
          	at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31)
          	at hudson.FilePath.act(FilePath.java:842)
          	at hudson.FilePath.act(FilePath.java:824)
          	at hudson.plugins.findbugs.FindBugsReporter.perform(FindBugsReporter.java:168)
          	at hudson.plugins.analysis.core.HealthAwareReporter.postExecute(HealthAwareReporter.java:304)
          	at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:421)
          	at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:403)
          	at com.t_systems_mms.reuse.maven.exec_listeners_extension.MojoTimeExecutionListener.mojoSucceeded(MojoTimeExecutionListener.java:130)
          	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)
          	... 18 more
          Caused by: java.lang.ClassCastException: org.dom4j.tree.QNameCache cannot be cast to org.dom4j.tree.QNameCache
          	at org.dom4j.QName.getCache(QName.java:253)
          	at org.dom4j.QName.get(QName.java:86)
          	at org.dom4j.QName.get(QName.java:95)
          	at org.jaxen.dom4j.DocumentNavigator.getAttributeAxisIterator(DocumentNavigator.java:298)
          	at org.jaxen.expr.iter.IterableAttributeAxis.namedAccessIterator(IterableAttributeAxis.java:96)
          	at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:180)
          	at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140)
          	at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113)
          	at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102)
          	at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674)
          	at org.jaxen.BaseXPath.selectSingleNodeForContext(BaseXPath.java:698)
          	at org.jaxen.BaseXPath.stringValueOf(BaseXPath.java:279)
          	at org.dom4j.xpath.DefaultXPath.valueOf(DefaultXPath.java:183)
          	at org.dom4j.tree.AbstractNode.valueOf(AbstractNode.java:191)
          	at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:567)
          	at edu.umd.cs.findbugs.PluginLoader.<init>(PluginLoader.java:280)
          	at edu.umd.cs.findbugs.PluginLoader.loadCorePlugin(PluginLoader.java:1304)
          	at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1259)
          	at edu.umd.cs.findbugs.PluginLoader.<clinit>(PluginLoader.java:146)
          	... 49 more
          

          Falko Modler added a comment - I tried patching Jenkins 1.471 as described in the blog article which did solve the DocumentFactory ClassCastException but another ClassCastException occured: java.lang.reflect.InvocationTargetException 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: java.lang.ExceptionInInitializerError at edu.umd.cs.findbugs.DetectorFactoryCollection.getCoreResource(DetectorFactoryCollection.java:360) at edu.umd.cs.findbugs.SystemProperties.loadPropertiesFromConfigFile(SystemProperties.java:72) at edu.umd.cs.findbugs.SystemProperties.<clinit>(SystemProperties.java:55) at edu.umd.cs.findbugs.SortedBugCollection.<clinit>(SortedBugCollection.java:185) at hudson.plugins.findbugs.parser.FindBugsParser.readXml(FindBugsParser.java:262) at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:206) at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:143) at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:103) at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:358) at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:317) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:266) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:31) at hudson.FilePath.act(FilePath.java:842) at hudson.FilePath.act(FilePath.java:824) at hudson.plugins.findbugs.FindBugsReporter.perform(FindBugsReporter.java:168) at hudson.plugins.analysis.core.HealthAwareReporter.postExecute(HealthAwareReporter.java:304) at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:421) at hudson.maven.Maven3Builder$MavenExecutionListener.mojoSucceeded(Maven3Builder.java:403) at com.t_systems_mms.reuse.maven.exec_listeners_extension.MojoTimeExecutionListener.mojoSucceeded(MojoTimeExecutionListener.java:130) 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) ... 18 more Caused by: java.lang.ClassCastException: org.dom4j.tree.QNameCache cannot be cast to org.dom4j.tree.QNameCache at org.dom4j.QName.getCache(QName.java:253) at org.dom4j.QName.get(QName.java:86) at org.dom4j.QName.get(QName.java:95) at org.jaxen.dom4j.DocumentNavigator.getAttributeAxisIterator(DocumentNavigator.java:298) at org.jaxen.expr.iter.IterableAttributeAxis.namedAccessIterator(IterableAttributeAxis.java:96) at org.jaxen.expr.DefaultNameStep.evaluate(DefaultNameStep.java:180) at org.jaxen.expr.DefaultLocationPath.evaluate(DefaultLocationPath.java:140) at org.jaxen.expr.DefaultAbsoluteLocationPath.evaluate(DefaultAbsoluteLocationPath.java:113) at org.jaxen.expr.DefaultXPathExpr.asList(DefaultXPathExpr.java:102) at org.jaxen.BaseXPath.selectNodesForContext(BaseXPath.java:674) at org.jaxen.BaseXPath.selectSingleNodeForContext(BaseXPath.java:698) at org.jaxen.BaseXPath.stringValueOf(BaseXPath.java:279) at org.dom4j.xpath.DefaultXPath.valueOf(DefaultXPath.java:183) at org.dom4j.tree.AbstractNode.valueOf(AbstractNode.java:191) at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:567) at edu.umd.cs.findbugs.PluginLoader.<init>(PluginLoader.java:280) at edu.umd.cs.findbugs.PluginLoader.loadCorePlugin(PluginLoader.java:1304) at edu.umd.cs.findbugs.PluginLoader.loadInitialPlugins(PluginLoader.java:1259) at edu.umd.cs.findbugs.PluginLoader.<clinit>(PluginLoader.java:146) ... 49 more

          Thomas Zlika added a comment -

          I'm exactly in the same situation as Falko :

          • I had the problem of the "org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory" exception
          • I tried to solve it with the solution from the blog article
          • Now I'm facing the "org.dom4j.tree.QNameCache cannot be cast to org.dom4j.tree.QNameCache" exception

          We are using Jenkins 1.437 on a RedHat Linux 6.2 server.
          We have Sonar installed on the same server, BUT we do not use any Sonar plugin during our Maven build.

          Is there any workaround for this annoying bug ?

          Regards,
          Thomas

          Thomas Zlika added a comment - I'm exactly in the same situation as Falko : I had the problem of the "org.dom4j.DocumentFactory Nested exception: org.dom4j.DocumentFactory" exception I tried to solve it with the solution from the blog article Now I'm facing the "org.dom4j.tree.QNameCache cannot be cast to org.dom4j.tree.QNameCache" exception We are using Jenkins 1.437 on a RedHat Linux 6.2 server. We have Sonar installed on the same server, BUT we do not use any Sonar plugin during our Maven build. Is there any workaround for this annoying bug ? Regards, Thomas

          Thomas Zlika added a comment -

          Hi guys,

          I think I may have found a possible cause for the problem: it seems that the Jenkins Findbugs plugin does not manage correctly multi-module maven builds (maybe because the Maven Findbugs plugin is not able to produce an aggregated report for multi-module projets ?)
          Anyway, if I uncheck the checkbox "Publish Findbugs analysis results" in my project configuration, the problem disappears !

          Regards,
          Thomas

          Thomas Zlika added a comment - Hi guys, I think I may have found a possible cause for the problem: it seems that the Jenkins Findbugs plugin does not manage correctly multi-module maven builds (maybe because the Maven Findbugs plugin is not able to produce an aggregated report for multi-module projets ?) Anyway, if I uncheck the checkbox "Publish Findbugs analysis results" in my project configuration, the problem disappears ! Regards, Thomas

          I just bumped into this when I changed a free-style job into native maven-job. Note: I didn't convert the job because it's not possible, simply created a new job with same configuration.

          I don't have "Publish Findbugs analysis results" enabled and the build still fails to the ClassCastException.

          Tuukka Mustonen added a comment - I just bumped into this when I changed a free-style job into native maven-job. Note: I didn't convert the job because it's not possible, simply created a new job with same configuration. I don't have "Publish Findbugs analysis results" enabled and the build still fails to the ClassCastException .

          YC Lian added a comment -

          I just bumped into this too. I don't have Findbugs enabled, and running the build outside of Jenkins won't have this issue (just to differentiate). Am on 1.502, the latest, and perhaps I will build with Maven 3 (this is a Maven 2 project).

          $ ~/tools/hudson.tasks.Maven_MavenInstallation/Maven_2/bin/mvn clean install
          ...
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESSFUL
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 50 seconds
          [INFO] Finished at: Tue Feb 19 19:33:31 MYT 2013
          [INFO] Final Memory: 102M/244M
          [INFO] ------------------------------------------------------------------------
          

          vs.

          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.Maven2Builder.postExecute(Maven2Builder.java:157)
          	at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:334)
          	at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170)
          	at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183)
          	... 34 more
          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)
          	... 41 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)
          	... 44 more
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 52 seconds
          [INFO] Finished at: Tue Feb 19 19:22:14 MYT 2013
          [INFO] Final Memory: 100M/239M
          [INFO] ------------------------------------------------------------------------
          Waiting for Jenkins to finish collecting data
          

          YC Lian added a comment - I just bumped into this too. I don't have Findbugs enabled, and running the build outside of Jenkins won't have this issue (just to differentiate). Am on 1.502, the latest, and perhaps I will build with Maven 3 (this is a Maven 2 project). $ ~/tools/hudson.tasks.Maven_MavenInstallation/Maven_2/bin/mvn clean install ... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 50 seconds [INFO] Finished at: Tue Feb 19 19:33:31 MYT 2013 [INFO] Final Memory: 102M/244M [INFO] ------------------------------------------------------------------------ vs. 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.Maven2Builder.postExecute(Maven2Builder.java:157) at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:334) at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(PluginManagerInterceptor.java:170) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterceptor.java:183) ... 34 more 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) ... 41 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) ... 44 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 52 seconds [INFO] Finished at: Tue Feb 19 19:22:14 MYT 2013 [INFO] Final Memory: 100M/239M [INFO] ------------------------------------------------------------------------ Waiting for Jenkins to finish collecting data

          David Vonka added a comment -

          no Findbugs here either, I'm on the same version as YC Lian. I get

          [INFO] Unable to execute mojo
          
          Embedded error: Failed to read <http://daily.semantacorp.com:8080/job/CE%20build/ws/semanta/target/surefire-reports/TEST-com.adaptavist.confluence.stats.StatsUtilTest.xml>
          org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory
          

          but when running maven as jenkins user from jenkins workspace from linux command line, everuthing is ok.

          David Vonka added a comment - no Findbugs here either, I'm on the same version as YC Lian. I get [INFO] Unable to execute mojo Embedded error: Failed to read <http: //daily.semantacorp.com:8080/job/CE%20build/ws/semanta/target/surefire-reports/TEST-com.adaptavist.confluence.stats.StatsUtilTest.xml> org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory but when running maven as jenkins user from jenkins workspace from linux command line, everuthing is ok.

          David Vonka added a comment -

          The guide here:
          http://www.beyondlinux.com/2011/04/20/running-sonar-in-jenkinshudson-org-dom4j-documentfactory-cannot-be-cast-to-org-dom4j-documentfactory/
          fixed the issue for me. Still, this is a bug, the guide is just a workaround.

          David Vonka added a comment - The guide here: http://www.beyondlinux.com/2011/04/20/running-sonar-in-jenkinshudson-org-dom4j-documentfactory-cannot-be-cast-to-org-dom4j-documentfactory/ fixed the issue for me. Still, this is a bug, the guide is just a workaround.

          Same message, should be linked.

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

          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.

          Duplicate of JENKINS-13709.

          Kohsuke Kawaguchi added a comment - Duplicate of JENKINS-13709 .

            kohsuke Kohsuke Kawaguchi
            walles walles
            Votes:
            15 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: