SonarQube Eclipse Plugin Causes Local Analysis Error

We are launching SonarQube 3.7. I am using the SonarQube plugin for Eclipse, version 3.2.0.20130627-1142, on Eclipse 3.7.2. I have connected my projects with SonarQube projects and am able to view problems from a large server side. However, if I switch to local analysis, I get the following error after running CheckStyle, PMD, etc.

15:16:23.217 INFO - Execute decorators... Exception in thread "main" org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:79) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:63) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41) at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59) Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'CLASSPATH.REDACTED.ClockEventHelperIT' at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:85) at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:71) at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:64) at org.sonar.batch.phases.DecoratorsExecutor.decorateResource(DecoratorsExecutor.java:64) at org.sonar.batch.phases.DecoratorsExecutor.execute(DecoratorsExecutor.java:56) at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:118) at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:142) at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88) at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73) at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:186) at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:181) at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:174) at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88) at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73) at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57) at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45) at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82) at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88) at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73) at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:156) at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:144) at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:88) at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:73) at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74) at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:75) ... 6 more Caused by: org.sonar.api.utils.HttpDownloader$HttpException: Fail to download [http://cm-sonar/api/sources?resource=REDACTED:shared-core:REDACTED.ClockEventHelperIT&format=txt]. Response code: 500 at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:266) at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:230) at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:88) at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:82) at org.sonar.batch.scan.LastSnapshots.loadSourceFromWs(LastSnapshots.java:62) at org.sonar.batch.scan.LastSnapshots.getSource(LastSnapshots.java:52) at org.sonar.plugins.core.issue.IssueTracking.mapIssues(IssueTracking.java:82) at org.sonar.plugins.core.issue.IssueTracking.track(IssueTracking.java:59) at org.sonar.plugins.core.issue.IssueTrackingDecorator.doDecorate(IssueTrackingDecorator.java:107) at org.sonar.plugins.core.issue.IssueTrackingDecorator.decorate(IssueTrackingDecorator.java:91) at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:80) ... 36 more 

Everything works fine on the server. Any ideas?

+6
source share
3 answers

I also encountered "Failed to execute Sonar ... Failed to load ... Response code: 500" with my installation (Sonar v3.7.2, Eclipse plugin v3.2 and Eclipse 4.3) when running local analysis.

I noticed one of my classes in my stacktrace called by a line (where your shows "ClockEventHelperIT"). The class does not exist in my server-side repository (it's new), and is also in the default Java package. It was a cool class, so I decided to remove it and restart the analysis. This solved it for me.

+1
source

We are facing the same problem with our projects. The “fix” we discovered is to make sure that the case when the username is in the sonar plugin verifies that they will be logged into the sonar server. This fixes this problem for now, although I'm not sure if it really fixes the problem.

When debugging, we did not find errors in the sonar logs, this is a very strange problem.

For your information, we perform local analysis in Eclipse on Windows 7, and our Sonar server runs on Red Hat Enterprise 6.2

0
source

We had the same problem, and for us it was because the class specified in the stack trace was in a non-standard folder (Maven standard). (i.e. outside of src/main/java, src/test/java, src/main/resources, src/test/resources ).

I reorganized these classes into standard Maven folders, and this problem was fixed.

0
source

Source: https://habr.com/ru/post/956126/


All Articles