Quantcast

NoClassDefFoundError after upgrade to sonar 3.2

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

NoClassDefFoundError after upgrade to sonar 3.2

dtriphaus
This post has NOT been accepted by the mailing list yet.
Hi,

I upgraded Sonar from 3.1.1 to 3.2 today and after upgrading my build breaks with a NoClassDefFoundException. This seems to be due to a move of the class UserRole from org.sonar.api.security to org.sonar.api.web
The stacktrace is pasted below.


Any clues how to fix this?

Thanks in advance and regards
Daniel


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.702s
[INFO] Finished at: Wed Aug 15 10:36:05 CEST 2012
[INFO] Final Memory: 31M/406M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar failed: A required class was missing while executing org.codehaus.mojo:sonar-maven-plugin:2.0:sonar: org/sonar/api/security/UserRole
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:2.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/opt/mvn/.m2/repository/org/codehaus/mojo/sonar-maven-plugin/2.0/sonar-maven-plugin-2.0.jar
[ERROR] urls[1] = file:/opt/mvn/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
[ERROR] urls[2] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
[ERROR] urls[3] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[4] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[5] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[6] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[7] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[8] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.sonar.api.security.UserRole
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXX: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar failed: A required class was missing while executing org.codehaus.mojo:sonar-maven-plugin:2.0:sonar: org/sonar/api/security/UserRole
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:2.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/opt/mvn/.m2/repository/org/codehaus/mojo/sonar-maven-plugin/2.0/sonar-maven-plugin-2.0.jar
urls[1] = file:/opt/mvn/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
urls[2] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
urls[3] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[4] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[5] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[6] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[7] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
urls[8] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

                 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
                 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.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
                 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
                 at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
                 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.launchEnhanced(Launcher.java:290)
                 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
                 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
                 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar failed: A required class was missing while executing org.codehaus.mojo:sonar-maven-plugin:2.0:sonar: org/sonar/api/security/UserRole
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:2.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/opt/mvn/.m2/repository/org/codehaus/mojo/sonar-maven-plugin/2.0/sonar-maven-plugin-2.0.jar
urls[1] = file:/opt/mvn/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
urls[2] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
urls[3] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[4] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[5] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[6] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[7] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
urls[8] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

                 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:127)
                 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
                 ... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.codehaus.mojo:sonar-maven-plugin:2.0:sonar: org/sonar/api/security/UserRole
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:sonar-maven-plugin:2.0
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/opt/mvn/.m2/repository/org/codehaus/mojo/sonar-maven-plugin/2.0/sonar-maven-plugin-2.0.jar
urls[1] = file:/opt/mvn/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
urls[2] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
urls[3] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
urls[4] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
urls[5] = file:/opt/mvn/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
urls[6] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
urls[7] = file:/opt/mvn/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
urls[8] = file:/opt/mvn/.m2/repository/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

                 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:125)
                 ... 20 more
Caused by: java.lang.NoClassDefFoundError: org/sonar/api/security/UserRole
                 at org.sonar.plugins.core.security.RoleManager.getUserRoles(RoleManager.java:53)
                 at org.sonar.plugins.core.security.ApplyProjectRolesDecorator.countRoles(ApplyProjectRolesDecorator.java:70)
                 at org.sonar.plugins.core.security.ApplyProjectRolesDecorator.shouldDecorateResource(ApplyProjectRolesDecorator.java:55)
                 at org.sonar.plugins.core.security.ApplyProjectRolesDecorator.decorate(ApplyProjectRolesDecorator.java:46)
                 at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:79)
                 at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:70)
                 at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:55)
                 at org.sonar.batch.phases.Phases.execute(Phases.java:94)
                 at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:139)
                 at org.sonar.batch.bootstrap.Module.start(Module.java:83)
                 at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:131)
                 at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:121)
                 at org.sonar.batch.bootstrap.Module.start(Module.java:83)
                 at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:121)
                 at org.sonar.batch.bootstrap.Module.start(Module.java:83)
                 at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:73)
                 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:60)
                 at org.sonar.maven3.SonarMojo.execute(SonarMojo.java:142)
                 at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:113)
                 at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:65)
                 at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:90)
                 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
                 ... 20 more
Caused by: java.lang.ClassNotFoundException: org.sonar.api.security.UserRole
                 at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
                 at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
                 at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
                 ... 42 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: NoClassDefFoundError after upgrade to sonar 3.2

dtriphaus
This post has NOT been accepted by the mailing list yet.
Sorry, works now.

Problem was that $SONAR_HOME did not get updated and pointed to the old $SONER_HOME from 3.1.1
Loading...