|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
ClassCastException with Hudson and SonarHi,
I have tried to have our project checked by Sonar and have this check integrated with Hudson. When I execute the maven goal sonar:sonar on the console everything works fine but in the Hudson environment I always get the error "Can not execute Sonar", see stacktrace below (created with -e parameter). It has to do with the tests because if I specify -DskipTests in Hudson for the project, the error doesn't occur. Do you have any idea where this error comes from and how I can get rid of it? And, one more question, isn't the Hudson Sonar plugin supposed to add some link to the link area to connect the Sonar results into the Hudson environment? I can't see such a link... Thanks in advance for your help! Wiebke Stacktrace: [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Can not execute Sonar Embedded error: Unable to execute maven plugin org.dom4j.DocumentFactory [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute Sonar at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:583) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:227) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:142) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExe cutorInterceptor.java:65) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) 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:585) 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:159) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:686) at hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632) at hudson.remoting.UserRequest.perform(UserRequest.java:104) at hudson.remoting.UserRequest.perform(UserRequest.java:48) at hudson.remoting.Request$2.run(Request.java:244) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja va:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6 75) at java.lang.Thread.run(Thread.java:595) Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute Sonar at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:87) at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65) at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:117) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:451) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce ptor.java:182) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:558) ... 28 more Caused by: org.sonar.api.utils.SonarException: Unable to execute maven plugin at org.sonar.batch.DefaultMavenPluginExecutor.execute(DefaultMavenPluginExecuto r.java:70) at org.sonar.batch.DefaultMavenPluginExecutor.execute(DefaultMavenPluginExecuto r.java:45) at org.sonar.batch.core.SensorsExecutor.executeMavenPlugin(SensorsExecutor.java :68) at org.sonar.batch.core.SensorsExecutor.execute(SensorsExecutor.java:58) at org.sonar.batch.Batch.executeJobs(Batch.java:91) at org.sonar.batch.Batch.analyse(Batch.java:79) at org.sonar.batch.Batch.start(Batch.java:54) at org.sonar.batch.Batch.start(Batch.java:50) at org.sonar.batch.Batch.start(Batch.java:50) at org.sonar.batch.Batch.start(Batch.java:50) at org.sonar.batch.BatchMojo.executeBatch(BatchMojo.java:138) at org.sonar.batch.BatchMojo.execute(BatchMojo.java:130) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage r.java:451) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce ptor.java:182) at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:82) ... 33 more Caused by: org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test': Failed to read D:\Work\CI\hudson\jobs\project_sonar\workspace\trunk\configuration\dao\impl\ target\surefire-reports\TEST-de.company.project.configuration.dao.hibernate. ConfigurationDaoImplTest.xml at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:562) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle (DefaultLifecycleExecutor.java:499) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(Def aultLifecycleExecutor.java:924) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLif ecycleExecutor.java:767) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:529) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De faultLifecycleExecutor.java:512) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec ycleExecutor.java:482) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail ures(DefaultLifecycleExecutor.java:330) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa ultLifecycleExecutor.java:291) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle Executor.java:142) at org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExe cutorInterceptor.java:65) at org.sonar.batch.DefaultMavenPluginExecutor.execute(DefaultMavenPluginExecuto r.java:65) ... 47 more Caused by: org.apache.maven.plugin.PluginManagerException: Failed to read D:\Work\CI\hudson\jobs\project_sonar\workspace\trunk\configuration\dao\impl\ target\surefire-reports\TEST-de.company.project.configuration.dao.hibernate. ConfigurationDaoImplTest.xml at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce ptor.java:195) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife cycleExecutor.java:558) ... 58 more Caused by: hudson.util.IOException2: Failed to read D:\Work\CI\hudson\jobs\project_sonar\workspace\trunk\configuration\dao\impl\ target\surefire-reports\TEST-de.company.project.configuration.dao.hibernate. ConfigurationDaoImplTest.xml at hudson.tasks.junit.TestResult.parse(TestResult.java:195) at hudson.tasks.junit.TestResult.parse(TestResult.java:136) at hudson.tasks.junit.TestResult.<init>(TestResult.java:99) at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:96 ) at hudson.maven.MavenModuleSetBuild$Builder.postExecute(MavenModuleSetBuild.jav a:747) at hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:287) at hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(Pl uginManagerInterceptor.java:170) at hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce ptor.java:183) ... 59 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:93) at hudson.tasks.junit.TestResult.parse(TestResult.java:180) ... 66 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) ... 69 more ______________________________________________________ GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT! Jetzt freischalten unter http://movieflat.web.de --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: ClassCastException with Hudson and SonarHi,
I actually had the same issue in my environment (hudson, mvn sonar:sonar). I have replaced this approach by the usage of the sonar plugin for hudson, which launch all sonar implementation after the build (I created a build on purpose, merely doing one compile), and everything is woking fine now. The only issue I had, is that you shouldn't leave the MAVEN_OPTS empty for the sonar execution. Re-using the default one from the hudson project broke the build. I haven't had to investigate why, but it is working fine now. So bottom line : use the hudson sonar plugin, and provide a MAVEN_OPTS for that plugin execution. And that will be working fine! Hope it helps! Denis. SchlumpfHB@... a écrit : > Hi, > > I have tried to have our project checked by Sonar and have this check > integrated with Hudson. When I execute the maven goal sonar:sonar on the > console everything works fine but in the Hudson environment I always get the > error "Can not execute Sonar", see stacktrace below (created with -e > parameter). It has to do with the tests because if I specify -DskipTests in > Hudson for the project, the error doesn't occur. > > Do you have any idea where this error comes from and how I can get rid of > it? And, one more question, isn't the Hudson Sonar plugin supposed to add > some link to the link area to connect the Sonar results into the Hudson > environment? I can't see such a link... > > Thanks in advance for your help! > > Wiebke > > Stacktrace: > > [INFO] > ------------------------------------------------------------------------ > > [ERROR] BUILD ERROR > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Can not execute Sonar > > Embedded error: Unable to execute maven plugin > > org.dom4j.DocumentFactory > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Trace > > org.apache.maven.lifecycle.LifecycleExecutionException: Can not execute > Sonar > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife > cycleExecutor.java:583) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De > faultLifecycleExecutor.java:512) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec > ycleExecutor.java:482) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail > ures(DefaultLifecycleExecutor.java:330) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa > ultLifecycleExecutor.java:227) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle > Executor.java:142) > > at > org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExe > cutorInterceptor.java:65) > > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336) > > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129) > > at org.apache.maven.cli.MavenCli.main(MavenCli.java:287) > > 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:585) > > 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:159) > > at > hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:686) > > at > hudson.maven.MavenModuleSetBuild$Builder.call(MavenModuleSetBuild.java:632) > > at hudson.remoting.UserRequest.perform(UserRequest.java:104) > > at hudson.remoting.UserRequest.perform(UserRequest.java:48) > > at hudson.remoting.Request$2.run(Request.java:244) > > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) > > at > java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) > > at java.util.concurrent.FutureTask.run(FutureTask.java:123) > > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.ja > va:650) > > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6 > 75) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: org.apache.maven.plugin.MojoExecutionException: Can not execute > Sonar > > at > org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:87) > > at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65) > > at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:117) > > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage > r.java:451) > > at > hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce > ptor.java:182) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife > cycleExecutor.java:558) > > ... 28 more > > Caused by: org.sonar.api.utils.SonarException: Unable to execute maven > plugin > > at > org.sonar.batch.DefaultMavenPluginExecutor.execute(DefaultMavenPluginExecuto > r.java:70) > > at > org.sonar.batch.DefaultMavenPluginExecutor.execute(DefaultMavenPluginExecuto > r.java:45) > > at > org.sonar.batch.core.SensorsExecutor.executeMavenPlugin(SensorsExecutor.java > :68) > > at > org.sonar.batch.core.SensorsExecutor.execute(SensorsExecutor.java:58) > > at org.sonar.batch.Batch.executeJobs(Batch.java:91) > > at org.sonar.batch.Batch.analyse(Batch.java:79) > > at org.sonar.batch.Batch.start(Batch.java:54) > > at org.sonar.batch.Batch.start(Batch.java:50) > > at org.sonar.batch.Batch.start(Batch.java:50) > > at org.sonar.batch.Batch.start(Batch.java:50) > > at org.sonar.batch.BatchMojo.executeBatch(BatchMojo.java:138) > > at org.sonar.batch.BatchMojo.execute(BatchMojo.java:130) > > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage > r.java:451) > > at > hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce > ptor.java:182) > > at > org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:82) > > ... 33 more > > Caused by: org.apache.maven.lifecycle.LifecycleExecutionException: Internal > error in the plugin manager executing goal > 'org.apache.maven.plugins:maven-surefire-plugin:2.4.2:test': Failed to read > D:\Work\CI\hudson\jobs\project_sonar\workspace\trunk\configuration\dao\impl\ > target\surefire-reports\TEST-de.company.project.configuration.dao.hibernate. > ConfigurationDaoImplTest.xml > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife > cycleExecutor.java:562) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle > (DefaultLifecycleExecutor.java:499) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(Def > aultLifecycleExecutor.java:924) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLif > ecycleExecutor.java:767) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife > cycleExecutor.java:529) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De > faultLifecycleExecutor.java:512) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec > ycleExecutor.java:482) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail > ures(DefaultLifecycleExecutor.java:330) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa > ultLifecycleExecutor.java:291) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle > Executor.java:142) > > at > org.apache.maven.lifecycle.LifecycleExecutorInterceptor.execute(LifecycleExe > cutorInterceptor.java:65) > > at > org.sonar.batch.DefaultMavenPluginExecutor.execute(DefaultMavenPluginExecuto > r.java:65) > > ... 47 more > > Caused by: org.apache.maven.plugin.PluginManagerException: Failed to read > D:\Work\CI\hudson\jobs\project_sonar\workspace\trunk\configuration\dao\impl\ > target\surefire-reports\TEST-de.company.project.configuration.dao.hibernate. > ConfigurationDaoImplTest.xml > > at > hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce > ptor.java:195) > > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife > cycleExecutor.java:558) > > ... 58 more > > Caused by: hudson.util.IOException2: Failed to read > D:\Work\CI\hudson\jobs\project_sonar\workspace\trunk\configuration\dao\impl\ > target\surefire-reports\TEST-de.company.project.configuration.dao.hibernate. > ConfigurationDaoImplTest.xml > > at hudson.tasks.junit.TestResult.parse(TestResult.java:195) > > at hudson.tasks.junit.TestResult.parse(TestResult.java:136) > > at hudson.tasks.junit.TestResult.<init>(TestResult.java:99) > > at > hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:96 > ) > > at > hudson.maven.MavenModuleSetBuild$Builder.postExecute(MavenModuleSetBuild.jav > a:747) > > at > hudson.maven.MavenBuilder$Adapter.postExecute(MavenBuilder.java:287) > > at > hudson.maven.agent.PluginManagerInterceptor$1MojoIntercepterImpl.callPost(Pl > uginManagerInterceptor.java:170) > > at > hudson.maven.agent.PluginManagerInterceptor.executeMojo(PluginManagerInterce > ptor.java:183) > > ... 59 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:93) > > at hudson.tasks.junit.TestResult.parse(TestResult.java:180) > > ... 66 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) > > ... 69 more > ______________________________________________________ > GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT! > Jetzt freischalten unter http://movieflat.web.de > > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
|
|
|
Re: ClassCastException with Hudson and SonarHello Wiebke,
I suspect that what you are talking about in your second question is SONARPLUGINS-165 ? Feel free to vote for this issue. Olivier On Thu, Oct 22, 2009 at 8:34 AM, <SchlumpfHB@...> wrote: Hi, |
| Free embeddable forum powered by Nabble | Forum Help |