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

ClassCastException parsing JUnit result

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: junit-plugin
    • Labels:
      None
    • Environment:
      Hudson version 1.377
      Windows Server 2008
    • Similar Issues:

      Description

      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
      

        Attachments

          Issue Links

            Activity

            Hide
            vonkad 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.

            Show
            vonkad 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.
            Hide
            vonkad 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.

            Show
            vonkad 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.
            Hide
            bacchella Fabrice Bacchella added a comment -

            Same message, should be linked.

            Show
            bacchella Fabrice Bacchella added a comment - Same message, should be linked.
            Hide
            ahorst 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.

            Show
            ahorst 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.
            Hide
            kohsuke Kohsuke Kawaguchi added a comment -

            Duplicate of JENKINS-13709.

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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: