• 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

          walles created issue -
          walles made changes -
          Description Original: 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.

          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
          New: 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:
          {code}
          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
          {code}

          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
          kutzi made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          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 made changes -
          Resolution Original: Cannot Reproduce [ 5 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

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

              Created:
              Updated:
              Resolved: