[GRADLE-1467] sonar task fails with java.lang.IncompatibleClassChangeError Created: 09/Apr/11  Updated: 04/Jan/13  Resolved: 21/Apr/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-2
Fix Version/s: 1.0-milestone-3

Type: Bug
Reporter: David Resnick Assignee: Peter Niederwieser
Resolution: Fixed Votes: 3


 Description   

Sonar task fails with the following exception:

FAILURE: Build aborted because of an internal error.

  • What went wrong:
    Build aborted because of an unexpected internal error. Please file an issue at: http://www.gradle.org.
  • Try:
    Run with --debug option to get additional debug info.
  • Exception is:
    java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.ClassLoader do not match. Expected 2 but got 3
    at groovy.lang.MetaClassImpl.selectConstructorAndTransformArguments(MetaClassImpl.java:1403)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.selectConstructorAndTransformArguments(ScriptBytecodeAdapter.java:237)
    at org.gradle.api.plugins.sonar.internal.ClassesOnlyClassLoader.<init>(ClassesOnlyClassLoader.groovy:24)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
    at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:198)
    at org.gradle.api.plugins.sonar.Sonar$_execute_closure1.doCall(Sonar.groovy:109)
    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.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
    at org.gradle.api.plugins.sonar.Sonar$_execute_closure1.doCall(Sonar.groovy)
    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.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:273)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:39)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
    at org.gradle.api.plugins.sonar.Sonar.withErrorSqlLogging(Sonar.groovy:253)
    at org.gradle.api.plugins.sonar.Sonar.this$5$withErrorSqlLogging(Sonar.groovy)
    at org.gradle.api.plugins.sonar.Sonar$this$5$withErrorSqlLogging.callCurrent(Unknown Source)
    at org.gradle.api.plugins.sonar.Sonar.execute(Sonar.groovy:104)
    at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
    at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
    at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
    at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:113)
    at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:153)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:107)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:75)
    at org.gradle.launcher.RunBuildAction.execute(RunBuildAction.java:41)
    at org.gradle.launcher.DaemonMain.build(DaemonMain.java:154)
    at org.gradle.launcher.DaemonMain.doRunWithExceptionHandling(DaemonMain.java:129)
    at org.gradle.launcher.DaemonMain.doRunWithLogging(DaemonMain.java:112)
    at org.gradle.launcher.DaemonMain.doRun(DaemonMain.java:98)
    at org.gradle.launcher.DaemonMain.access$000(DaemonMain.java:50)
    at org.gradle.launcher.DaemonMain$1.handle(DaemonMain.java:80)
    at org.gradle.launcher.DaemonConnector$1.execute(DaemonConnector.java:165)
    at org.gradle.launcher.DaemonConnector$1.execute(DaemonConnector.java:162)
    at org.gradle.messaging.remote.internal.TcpIncomingConnector$Receiver.run(TcpIncomingConnector.java:102)
    at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63)
    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)

BUILD FAILED

Total time: 2.121 secs



 Comments   
Comment by Kelly Robinson [ 10/Apr/11 ]

Same exception thrown while trying to test drive the new Sonar plugin. Here's the output from gradle -v, on the off chance it's system specific.

------------------------------------------------------------
Gradle 1.0-milestone-2
------------------------------------------------------------

Gradle build time: Friday, 8 April 2011 03:06:53 PM EST
Groovy: 1.7.10
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_24 (Apple Inc. 19.1-b02-334)
OS: Mac OS X 10.6.7 x86_64

Comment by Matt Stine [ 20/Apr/11 ]

Tried the same this morning and got the same result as these guys.

My environment FYI:

------------------------------------------------------------
Gradle 1.0-milestone-2
------------------------------------------------------------

Gradle build time: Friday, 8 April 2011 03:06:53 PM EST
Groovy: 1.7.10
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_22 (Apple Inc. 17.1-b03-307)
OS: Mac OS X 10.6.6 x86_64

Comment by Justin Redd [ 21/Apr/11 ]

I get the same result as well.

My env:

------------------------------------------------------------
Gradle 1.0-milestone-2
------------------------------------------------------------

Gradle build time: Friday, 8 April 2011 03:06:53 PM EST
Groovy: 1.7.10
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_23 (Sun Microsystems Inc. 19.0-b09)
OS: Windows XP 5.1 x86

Generated at Wed Jun 30 11:56:14 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.