I used a locally installed Sonar 3.2 with a Gradle-1.1 project. I could reproduce the error on at least two machines with the attached project (a 'hello world' app with a gradle wrapper to get a consistent environment).
I suspected that the Logger class gets loaded by different class loaders and set GRADLE_OPTS="-verbose:class". The first few lines show that two logback-classic versions are used indeed, but I can't tell if that is really a problem.
./gradlew --debug --stacktrace --no-daemon sonarAnalyze|grep "ch.qos.logback.classic.Logger"
[Loaded ch.qos.logback.classic.LoggerContext from file:/Users/eoswald/.gradle/wrapper/dists/gradle-1.1-bin/13d7lnhcrghv2i5e54el41jpgr/gradle-1.1/lib/logback-classic-1.0.6.jar]
[Loaded ch.qos.logback.classic.Logger from file:/Users/eoswald/.gradle/wrapper/dists/gradle-1.1-bin/13d7lnhcrghv2i5e54el41jpgr/gradle-1.1/lib/logback-classic-1.0.6.jar]
[Loaded ch.qos.logback.classic.LoggerContext from file:/Users/eoswald/Projects/Ergon/Portfolio/hello/build/sonar/batch/logback-classic-0.9.30.jar]
[Loaded ch.qos.logback.classic.Logger from file:/Users/eoswald/Projects/Ergon/Portfolio/hello/build/sonar/batch/logback-classic-0.9.30.jar]
15:42:30.551 [ERROR] [org.gradle.BuildExceptionReporter]
15:42:30.563 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
15:42:30.570 [ERROR] [org.gradle.BuildExceptionReporter]
15:42:30.571 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
15:42:30.572 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarAnalyze'.
15:42:30.575 [ERROR] [org.gradle.BuildExceptionReporter] > PicoLifecycleException: method 'public org.sonar.core.persistence.MyBatis org.sonar.core.persistence.MyBatis.start()', instance 'org.sonar.core.persistence.MyBatis@3c38a6d2, java.lang.RuntimeException: wrapper
15:42:30.576 [ERROR] [org.gradle.BuildExceptionReporter]
15:42:30.577 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
15:42:30.579 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarAnalyze'.
15:42:30.581 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:68)
15:42:30.581 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
15:42:30.583 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
15:42:30.584 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter$1.run(CacheLockHandlingTaskExecuter.java:34)
15:42:30.585 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$2.create(DefaultCacheAccess.java:200)
15:42:30.589 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:172)
15:42:30.590 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:198)
15:42:30.590 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:137)
15:42:30.592 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
15:42:30.594 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.CacheLockHandlingTaskExecuter.execute(CacheLockHandlingTaskExecuter.java:32)
15:42:30.595 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
15:42:30.612 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
15:42:30.613 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
15:42:30.614 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
15:42:30.615 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
15:42:30.618 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
15:42:30.620 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:247)
15:42:30.622 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
15:42:30.624 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
15:42:30.625 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
15:42:30.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
15:42:30.627 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
15:42:30.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
15:42:30.628 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
15:42:30.631 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
15:42:30.631 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess$1.create(DefaultCacheAccess.java:111)
15:42:30.632 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:126)
15:42:30.633 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:109)
15:42:30.634 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:129)
15:42:30.635 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
15:42:30.635 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.changedetection.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
15:42:30.637 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
15:42:30.637 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
15:42:30.638 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
15:42:30.638 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
15:42:30.639 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
15:42:30.640 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
15:42:30.640 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
15:42:30.641 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:110)
15:42:30.641 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:78)
15:42:30.642 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
15:42:30.643 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
15:42:30.644 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:25)
15:42:30.651 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
15:42:30.654 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:30)
15:42:30.670 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ActionAdapter.execute(ActionAdapter.java:22)
15:42:30.671 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:200)
15:42:30.672 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:173)
15:42:30.672 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
15:42:30.673 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:138)
15:42:30.673 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
15:42:30.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
15:42:30.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.doAction(Main.java:48)
15:42:30.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
15:42:30.676 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.Main.main(Main.java:39)
15:42:30.676 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
15:42:30.677 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
15:42:30.677 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
15:42:30.678 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
15:42:30.678 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
15:42:30.697 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
15:42:30.698 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public org.sonar.core.persistence.MyBatis org.sonar.core.persistence.MyBatis.start()', instance 'org.sonar.core.persistence.MyBatis@3c38a6d2, java.lang.RuntimeException: wrapper
15:42:30.699 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:77)
15:42:30.699 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:132)
15:42:30.700 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115)
15:42:30.701 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
15:42:30.701 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
15:42:30.703 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
15:42:30.703 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
15:42:30.715 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.behaviors.Stored.start(Stored.java:110)
15:42:30.716 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1009)
15:42:30.733 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
15:42:30.733 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:760)
15:42:30.734 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:70)
15:42:30.734 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.bootstrap.Module.start(Module.java:82)
15:42:30.735 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.Batch.execute(Batch.java:104)
15:42:30.735 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.batch.Batch$execute.call(Unknown Source)
15:42:30.736 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.sonar.internal.SonarCodeAnalyzer.execute(SonarCodeAnalyzer.groovy:51)
15:42:30.736 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.sonar.internal.SonarCodeAnalyzer$execute.call(Unknown Source)
15:42:30.737 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.sonar.SonarAnalyze.analyze(SonarAnalyze.groovy:48)
15:42:30.738 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:196)
15:42:30.738 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:102)
15:42:30.739 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:99)
15:42:30.739 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.plugins.sonar.SonarAnalyze_Decorated.invokeMethod(Unknown Source)
15:42:30.739 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
15:42:30.740 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:150)
15:42:30.743 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:145)
15:42:30.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:472)
15:42:30.744 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:461)
15:42:30.745 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:60)
15:42:30.746 [ERROR] [org.gradle.BuildExceptionReporter] ... 60 more
15:42:30.746 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.RuntimeException: wrapper
15:42:30.747 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:130)
15:42:30.747 [ERROR] [org.gradle.BuildExceptionReporter] ... 86 more
15:42:30.748 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.ClassCastException: ch.qos.logback.classic.Logger cannot be cast to ch.qos.logback.classic.Logger
15:42:30.748 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.config.Logback.setLoggerLevel(Logback.java:89)
15:42:30.749 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.persistence.MyBatis.configureLogback(MyBatis.java:167)
15:42:30.751 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.core.persistence.MyBatis.start(MyBatis.java:122)
15:42:30.752 [ERROR] [org.gradle.BuildExceptionReporter] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
15:42:30.752 [ERROR] [org.gradle.BuildExceptionReporter] ... 85 more
15:42:30.753 [ERROR] [org.gradle.BuildExceptionReporter]
|