Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-2011

ClassNotFoundException when running SonarAnalyze

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Resolution: Unresolved
  • Affects Version/s: 1.0-milestone-6
  • Fix Version/s: None

Description

Reported by Matthew and Erik Weibust.

When running SonarAnalyze, some people got the following exception. Further details:

  • Sonar 2.11
  • Clean Mac Lion install without an installed Gradle for some people (using the wrapper)
  • Gradle Milestone 6 being used by everyone
  • Problem exhibited on Windows and Mac
  • Mac latest JDK for some people
  • No daemon

See attachment for analyzed project.

$ ./gradlew sonar -S > error.txt

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonarAnalyze'.
Cause: org.gradle.api.plugins.sonar.internal.SonarCodeAnalyzer

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarAnalyze'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:71)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:48)
	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
	at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:243)
	at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:192)
	at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:177)
	at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:83)
	at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:36)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70)
	at org.gradle.execution.DefaultBuildExecuter.access$300(DefaultBuildExecuter.java:23)
	at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:80)
	at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:70)
	at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:63)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:157)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:80)
	at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:42)
	at org.gradle.launcher.cli.RunBuildAction.execute(RunBuildAction.java:28)
	at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:32)
	at org.gradle.launcher.exec.ExceptionReportingAction.execute(ExceptionReportingAction.java:21)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:233)
	at org.gradle.launcher.cli.CommandLineActionFactory$WithLoggingAction.execute(CommandLineActionFactory.java:217)
	at org.gradle.launcher.Main.doAction(Main.java:48)
	at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:53)
	at org.gradle.launcher.exec.EntryPoint$1.execute(EntryPoint.java:51)
	at org.gradle.launcher.exec.Execution.execute(Execution.java:28)
	at org.gradle.launcher.exec.EntryPoint.run(EntryPoint.java:39)
	at org.gradle.launcher.Main.main(Main.java:39)
	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.gradle.launcher.ProcessBootstrap.runNoExit(ProcessBootstrap.java:51)
	at org.gradle.launcher.ProcessBootstrap.run(ProcessBootstrap.java:33)
	at org.gradle.launcher.GradleMain.main(GradleMain.java:24)
	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.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
	at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:124)
	at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:53)
Caused by: java.lang.ClassNotFoundException: org.gradle.api.plugins.sonar.internal.SonarCodeAnalyzer
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at org.sonar.batch.bootstrapper.BootstrapClassLoader.findClass(BootstrapClassLoader.java:52)
	at org.sonar.batch.bootstrapper.BootstrapClassLoader.loadClass(BootstrapClassLoader.java:86)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java_lang_ClassLoader$loadClass.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.gradle.api.plugins.sonar.SonarAnalyze.analyze(SonarAnalyze.groovy:45)
	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 groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1054)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:884)
	at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
	at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
	at org.gradle.api.plugins.sonar.SonarAnalyze_Decorated.invokeMethod(Unknown Source)
	at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:55)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
	at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:129)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:127)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:63)
	... 48 more
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    gradle-sonar-java-build-file.zip
    21/Dec/11 8:16 PM
    48 kB
    Peter Niederwieser
    1. File
      gradle-sonar-java-build-file/.DS_Store 6 kB
    2. File
      __MACOSX/.../._.DS_Store 0.1 kB
    3. File
      gradle-sonar-java-build-file/build.gradle 0.3 kB
    4. File
      __MACOSX/.../._build.gradle 0.1 kB
    5. File
      gradle-sonar-java-build-file/.../.DS_Store 6 kB
    6. File
      __MACOSX/.../._.DS_Store 0.1 kB
    7. Java Archive File
      gradle-sonar-java-build-file/.../gradle-wrapper.jar 40 kB
    8. File
      gradle-sonar-java-build-file/.../gradle-wrapper.properties 0.2 kB
    9. File
      gradle-sonar-java-build-file/gradlew 5 kB
    10. File
      __MACOSX/.../._gradlew 0.2 kB
    11. File
      gradle-sonar-java-build-file/gradlew.bat 2 kB
    12. File
      gradle-sonar-java-build-file/run-example.bsh 0.1 kB
    13. File
      __MACOSX/.../._run-example.bsh 0.2 kB
    14. Java Source File
      gradle-sonar-java-build-file/.../Another.java 0.3 kB
    15. Java Source File
      __MACOSX/.../._Another.java 0.1 kB
    16. Java Source File
      gradle-sonar-java-build-file/.../Main.java 0.2 kB
    17. Java Source File
      __MACOSX/.../._Main.java 0.1 kB
    18. Java Source File
      gradle-sonar-java-build-file/.../TestMain.java 0.5 kB
    19. Java Source File
      __MACOSX/.../._TestMain.java 0.1 kB
    Download Zip
    Show
    Zip Archive
    gradle-sonar-java-build-file.zip
    21/Dec/11 8:16 PM
    48 kB
    Peter Niederwieser
  2. Text File
    sonar-gradle-error_12_23_2011.txt
    23/Dec/11 11:50 AM
    5 kB
    Erik Weibust
  3. Text File
    sonar-gradle-error.txt
    22/Dec/11 3:47 PM
    5 kB
    Erik Weibust

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Peter Niederwieser added a comment - 21/Dec/11 8:33 PM

So far I haven't been able to reproduce this. Tried with Sonar 2.11 and 2.12, the attached project and the Spock project, with and w/o daemon, with and w/o wrapper. Always worked as expected for me. Mac OS 10.6.8, latest (Mac) JDK 6.

Matthew, did you ever see this problem on your own machine? Any further hints you can think of?

Show
Peter Niederwieser added a comment - 21/Dec/11 8:33 PM So far I haven't been able to reproduce this. Tried with Sonar 2.11 and 2.12, the attached project and the Spock project, with and w/o daemon, with and w/o wrapper. Always worked as expected for me. Mac OS 10.6.8, latest (Mac) JDK 6. Matthew, did you ever see this problem on your own machine? Any further hints you can think of?
Hide
Permalink
Matthew J. McCullough added a comment - 21/Dec/11 10:10 PM

Never did see it on my machine, but did on four student machines at Rich Web. Our best hope is to reach out to Erik Weibust since he had a pristine machine and was able to reliably reproduce it. I'll add him and ask for his input.

Show
Matthew J. McCullough added a comment - 21/Dec/11 10:10 PM Never did see it on my machine, but did on four student machines at Rich Web. Our best hope is to reach out to Erik Weibust since he had a pristine machine and was able to reliably reproduce it. I'll add him and ask for his input.
Hide
Permalink
Erik Weibust added a comment - 22/Dec/11 3:47 PM

Still having the same problem. I'm attaching the stack trace. Please let me know what else I can provide.

Erik

Show
Erik Weibust added a comment - 22/Dec/11 3:47 PM Still having the same problem. I'm attaching the stack trace. Please let me know what else I can provide. Erik
Hide
Permalink
Erik Weibust added a comment - 22/Dec/11 3:47 PM

Stack trace for the specifics on this ticket.

Show
Erik Weibust added a comment - 22/Dec/11 3:47 PM Stack trace for the specifics on this ticket.
Hide
Permalink
Peter Niederwieser added a comment - 22/Dec/11 4:20 PM

This stack trace is different, and I think I know what's going on. The Sonar client library used by the SonarAnalyze task tries to bootstrap itself by downloading files from the Sonar server, but something (probably your OS firewall) is preventing it from doing so.

Show
Peter Niederwieser added a comment - 22/Dec/11 4:20 PM This stack trace is different, and I think I know what's going on. The Sonar client library used by the SonarAnalyze task tries to bootstrap itself by downloading files from the Sonar server, but something (probably your OS firewall) is preventing it from doing so.
Hide
Permalink
Peter Niederwieser added a comment - 22/Dec/11 4:22 PM

Maybe the original stack trace is a consecutive error happening on subsequent runs? Can you confirm that, or do you always get the stack trace you just posted?

Show
Peter Niederwieser added a comment - 22/Dec/11 4:22 PM Maybe the original stack trace is a consecutive error happening on subsequent runs? Can you confirm that, or do you always get the stack trace you just posted?
Hide
Permalink
Erik Weibust added a comment - 23/Dec/11 11:48 AM

Well, I tried again and get the same "Connection refused" error I was getting yesterday. Today I'm trying from my home network. Yesterday I was attempting while at work. I'm not sure if that matters.

I also noticed the error message was slightly different when trying in Florida at RWX.

Show
Erik Weibust added a comment - 23/Dec/11 11:48 AM Well, I tried again and get the same "Connection refused" error I was getting yesterday. Today I'm trying from my home network. Yesterday I was attempting while at work. I'm not sure if that matters. I also noticed the error message was slightly different when trying in Florida at RWX.
Hide
Permalink
Erik Weibust added a comment - 23/Dec/11 11:50 AM

Attempting from home network and getting same stack trace.

Show
Erik Weibust added a comment - 23/Dec/11 11:50 AM Attempting from home network and getting same stack trace.
Hide
Permalink
Peter Niederwieser added a comment - 13/Jan/12 3:27 PM

If it's not a personal firewall issue, maybe you have started the Sonar server on a different port? In that case you'll have to configure sonar.server.url accordingly. Can you try to set this property to the same URL that you use in the browser to access the Sonar web interface? This definitely looks like an environment issue to me.

Show
Peter Niederwieser added a comment - 13/Jan/12 3:27 PM If it's not a personal firewall issue, maybe you have started the Sonar server on a different port? In that case you'll have to configure sonar.server.url accordingly. Can you try to set this property to the same URL that you use in the browser to access the Sonar web interface? This definitely looks like an environment issue to me.

People

  • Assignee:
    Unassigned
    Reporter:
    Peter Niederwieser
Vote (1)
Watch (2)

Dates

  • Created:
    21/Dec/11 8:16 PM
    Updated:
    13/Jan/12 3:27 PM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.