Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failure with Sonar 5.0 #395

Closed
iwill80 opened this issue Jan 21, 2015 · 16 comments
Closed

Execution failure with Sonar 5.0 #395

iwill80 opened this issue Jan 21, 2015 · 16 comments
Assignees
Milestone

Comments

@iwill80
Copy link

iwill80 commented Jan 21, 2015

Hello,
I'm having some trouble using sonar-cxx-0.9.2 with sonarqube 5.0. I get the following error running the cpp-sonar-runner inside the sonar-example-masters. The same was working with cxx plugin version 0.90 and sonar 3.7.

ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: COMMENT_BLANK_LINES

The following is the result running sonar-runner with -e option
...
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 7.149s
Final Memory: 24M/673M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: java.lang.NoSuchFieldError: COMMENT_BLANK_LINES
at org.sonar.plugins.cxx.squid.CxxSquidSensor.saveMeasures(CxxSquidSensor.java:136)
at org.sonar.plugins.cxx.squid.CxxSquidSensor.save(CxxSquidSensor.java:121)
at org.sonar.plugins.cxx.squid.CxxSquidSensor.analyse(CxxSquidSensor.java:99)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:122)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

@guwirth
Copy link
Collaborator

guwirth commented Jan 21, 2015

Version 0.9.2 is not tested and released for SQ 5.

@iwill80
Copy link
Author

iwill80 commented Jan 21, 2015

Sorry, I haven't checked the compatibility matrix

@jfallot
Copy link

jfallot commented Jan 23, 2015

yes, looks like SQ 5 isn't anymore loading the sslr-cxx-toolkit jar from the extensions/plugins subfolder.
Any hints to pursue the troubleshooting ?

@jkonoth
Copy link

jkonoth commented Feb 8, 2015

I am a newbie to sonar too and even I observed this error today. Is there any way forward to solving this issue?

@guwirth
Copy link
Collaborator

guwirth commented Feb 8, 2015

There is no workaround. Current V0.9.2 supports only SQ 4.5. With SQ 5 there are again API changes which are not supported currently.

@Bertk
Copy link
Contributor

Bertk commented Feb 8, 2015

The reported compatibility is related to Deprecate metric comment_blank_lines (https://jira.codehaus.org/browse/SONAR-3768).
The SonarQube API updates are available here: http://docs.sonarqube.org/display/SONAR/API+Changes

@Bertk
Copy link
Contributor

Bertk commented Feb 9, 2015

PR which removes metric comment_blank_lines #423.
Code analysis with SonarQube 5.0 is still running and some more updates might be necessary 😉

@jfallot
Copy link

jfallot commented Feb 9, 2015

Works fine, thank you @Bertk!

@ttoleung
Copy link

First of all, a very useful plug-in. So I assume next release should be compatible with SQ5? when can we expect that to happen? Thanks.

@jmecosta
Copy link
Member

No decisions yet, however fix has been merged to master. You can build the
sources so you don't get stuck

On Thu, Feb 12, 2015, 05:04 Terry Leung [email protected] wrote:

First of all, a very useful plug-in. So I assume next release should be
compatible with SQ5? when can we expect that to happen? Thanks.


Reply to this email directly or view it on GitHub
#395 (comment).

@Bertk
Copy link
Contributor

Bertk commented Feb 15, 2015

I did some tests and unfortunately the analysis failed but I use some extensions of C++ community plug-in (reactor).

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
        at org.sonar.runner.api.Runner.execute(Runner.java:100)
        at org.sonar.runner.Main.executeTask(Main.java:70)
        at org.sonar.runner.Main.execute(Main.java:59)
        at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonar.api.utils.SonarException: Fail to decorate 'org.sonar.api.resources.File@19b7e697[key=Selector.cpp,deprecatedKey=Selector.cpp,path=Selector.cpp,dir=[root],filename=Selector.cpp,language=c++]'
        at org.sonar.batch.phases.DecoratorsExecutor.executeDecorator(DecoratorsExecutor.java:103)

Maybe the deprecated API list shall be reviewed or better eliminate deprecated API from C++ community plug-in (http://javadocs.sonarsource.org/4.5.2/apidocs/deprecated-list.html).

@curtpm
Copy link

curtpm commented Feb 25, 2015

Built and deployed SNAPSHOT of master to our 5.0 sonar server and everything seems to be working fine.

@javiplx
Copy link

javiplx commented Mar 11, 2015

I use also sonar 5.0, and had a different error to the one reported here, but it was also solved after deploying current snapshot.

@guwirth
Copy link
Collaborator

guwirth commented Apr 9, 2015

Solved with #423 / V0.9.3

@guwirth guwirth closed this as completed Apr 9, 2015
@vishwnahak
Copy link

Hi

Anyone used sonar-runner in Android studio , when I run command "gradle sonarRunner" through terminal it give error as below :
"Can not invoke method public java.lang.Class org.sonar.plugins.surefire.SurefireSensor.dependsUponCoverageSensors()"

My Build.gradle file as below:
apply plugin: 'sonar-runner'

sonarRunner {
sonarProperties {
// can be also set on command line like -Dsonar.analysis.mode=incremental
property "sonar.host.url", "http://myserver.com"
property 'sonar.sourceEncoding', 'UTF-8'
property 'sonar.language', 'java'
property 'sonar.projectKey', 'com.projectKey'
//need to replace with your project package name
property 'sonar.projectName', 'projectName' // need to replace with your project name
property 'sonar.projectVersion', '1.0'
property 'sonar.sources', 'src/main/java'
}
}

If any one have any solution then please help me I am stuck here.

My Android studio version- 1.3.2
SonarQube Runner 2.3
SonarQube Server 5.3

@jmecosta
Copy link
Member

jmecosta commented Jun 3, 2016

hi,

supose you should ask this in the sonar gougle groups, this is for c++ source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

10 participants