Sonar runner 2.3 throws exception with Sonar 3.7 --> IllegalDataException - sonarqube

I am trying to analyse Java project using SOnar 3.7 & sonar-runner 2.3.
I was successfully able to analyse same codebase using Sonar 3.6.1 & Sonar runner 2.2.1 with same rule set/profile.
However, when I have upgraded version then I am having following errors...
org.jdom.IllegalDataException: The data "null" is not legal for a JDO
M attribute: A null is not a legal XML value
Console Output :
SonarQube Runner 2.3 Java 1.6.0_30 Sun Microsystems Inc. (64-bit) Windows 7 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Dhruba\InstallationFolder\Sonar\sonar-runner-2.3\conf\sonar-runner.properties
INFO: Project configuration file: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar
INFO: SonarQube Server 3.7
13:38:29.376 INFO - Load batch settings
13:38:29.482 INFO - User cache: C:\Users\Dhruba\.sonar\cache
13:38:29.487 INFO - Install plugins
13:38:31.219 INFO - Install JDBC driver
13:38:31.227 INFO - Create JDBC datasource for jdbc:oracle:thin:#localhost:1521 /orcl
13:38:32.382 INFO - Initializing Hibernate 13:38:34.579 INFO - Load project settings
13:38:34.665 INFO - Apply project exclusions
13:38:34.788 INFO - ------------- Scan OPSBankIIUtilityService
13:38:34.790 INFO - Load module settings
13:38:35.382 INFO - Quality profile : [name=OBBase1,language=java]
13:38:35.394 INFO - Excluded sources:
13:38:35.394 INFO - **/*_*.java
13:38:35.394 INFO - **/bo/**
13:38:35.395 INFO - */stub/**
13:38:35.395 INFO - **/*FacadeSoap*.java
13:38:35.395 INFO - com.ibm.ejs.container._EJSWrapper_**/src
13:38:35.395 INFO - *_Deser/src
13:38:35.395 INFO - *Proxy.java
13:38:35.395 INFO - */*FacadeHome.java
13:38:35.395 INFO - */*FacadeLocalHome.java 13:38:35.395 INFO - com/elsevier/obii/xml/*
13:38:35.395 INFO - Excluded tests:
13:38:35.395 INFO - */package-info.java
13:38:35.430 INFO - Configure Maven plugins
13:38:35.502 INFO - Compare to previous analysis
13:38:35.532 INFO - Compare over 7 days (2013-09-14)
13:38:35.558 INFO - Compare to previous version
13:38:35.734 INFO - Base dir: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\OPSBankIIUtilityService
13:38:35.734 INFO - Working dir: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService
13:38:35.735 INFO - Source dirs: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\OPSBankIIUtilityService\src
13:38:35.735 INFO - Source encoding: windows-1252, default locale: en_US
13:38:36.090 INFO - Sensor JavaSourceImporter...
13:38:37.021 INFO - Sensor JavaSourceImporter done: 931 ms
13:38:37.021 INFO - Sensor JavaSquidSensor...
13:38:37.160 INFO - Java AST scan...
13:38:40.518 INFO - Java AST scan done: 3358 ms
13:38:40.763 INFO - Sensor JavaSquidSensor done: 3742 ms
13:38:40.764 INFO - Sensor SurefireSensor...
13:38:40.765 INFO - parsing C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService\build\surefire-reports
13:38:40.767 INFO - Sensor SurefireSensor done: 3 ms
13:38:40.769 INFO - Sensor CpdSensor...
13:38:40.770 INFO - SonarEngine is used
13:38:40.846 INFO - Cross-project analysis disabled
13:38:41.511 INFO - Sensor CpdSensor done: 742 ms
13:38:41.511 INFO - Sensor CheckstyleSensor...
13:38:41.514 INFO - Execute Checkstyle 5.6...
13:38:41.534 INFO - Checkstyle configuration: C:\Dhruba\Projects\Elsevier-OPSBANK_II_AIS\R11_Service_Workspace\.sonar\dhrsrvc_OPSBankIIUtilityService\checkstyle.xml
13:38:43.845 INFO - Execute Checkstyle 5.6 done: 2331 ms
13:38:43.849 INFO - Sensor CheckstyleSensor done: 2338 ms
13:38:43.850 INFO - Sensor PmdSensor...
13:38:43.853 INFO - Execute PMD 4.3...
13:38:43.864 INFO - Java version: 1.5
13:38:44.008 INFO - Execute PMD 4.3 done: 155 ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 17.761s Final Memory: 15M/406M
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:90)
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:41) Caused by: org.sonar.api.utils.XmlParserException: org.jdom.IllegalDataException : The data "null" is not legal for a JDOM attribute: A null is not a legal XML value.
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:55)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:72)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:114)
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.scanRecursively(ProjectScanContainer.java:179)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
**Caused by: org.jdom.IllegalDataException: The data "null" is not legal for a JDO M attribute: A null is not a legal XML value.**
at org.jdom.Attribute.setValue(Attribute.java:486)
at org.jdom.Attribute.<init>(Attribute.java:229)
at org.jdom.Attribute.<init>(Attribute.java:252)
at org.jdom.Element.setAttribute(Element.java:1109)
at org.sonar.plugins.pmd.PmdProfileExporter.exportPmdRulesetToXml(PmdProfileExporter.java:126)
at org.sonar.plugins.pmd.PmdProfileExporter.exportProfile(PmdProfileExporter.java:63)
at org.sonar.plugins.pmd.PmdExecutor.createRulesets(PmdExecutor.java:107)
at org.sonar.plugins.pmd.PmdExecutor.executeRules(PmdExecutor.java:89)
at org.sonar.plugins.pmd.PmdExecutor.executePmd(PmdExecutor.java:75)
at org.sonar.plugins.pmd.PmdExecutor.execute(PmdExecutor.java:61)
at org.sonar.plugins.pmd.PmdSensor.analyse(PmdSensor.java:52)
... 37 more ERROR: ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Can you please help to resolve this one ?

I was analyzing the issue and found that imported profile from Sonar 3.6.1 to 3.7 had issue. Sonar 3.7 was not able to parse few of the XPath rules.
Therefore, I have just removed those XPath rules and re-added them manually and it starts working. This issue is not a bug of Sonar-runner instead Sonar 3.7 could not restore profiles correctly.

Related

SonarQube 5.3 stopped analyzing Github pull requests

We have recently updated our SonarQube version from 5.0 to 5.3 and our SonarQube Scanner/Runner from 2.3 to 2.4.
During this upgrade, SonarQube has stopped analyzing our GitHub pull requests. We run the SonarQube Scanner as the last step in our jenkins job.
The command we run is as follows:
/usr/local/sonar-runner/bin/sonar-runner -Dsonar.analysis.mode=issues \
-Dsonar.github.pullRequest=${ghprbPullId} \
-Dsonar.github.repository=OurRepository/OurRepository \
-Dsonar.github.login=MyUsername \
-Dsonar.github.oauth=MyToken \
-Dsonar.login=MyUsername \
-Dsonar.password=MyPassword \
-Dsonar.sources=./app/ \
-Dsonar.projectKey=MyProject \
-Dsonar.projectName=MyProject \
-Dsonar.projectVersion=2.9.0 \
-Dsonar.exclusions=app/Vendor/**,app/Plugin/**/Test/**,app/Test/**
The only thing we changed during this upgrade is the analysis mode. Before the upgrade we used the incremental mode which has been removed in 5.2.
The output of the command is as follows:
+ /usr/local/sonar-runner/bin/sonar-runner -Dsonar.analysis.mode=issues -Dsonar.github.pullRequest=2944 -Dsonar.github.repository=OurRepository/OurRepository -Dsonar.github.login=Username -Dsonar.github.oauth=MyToken -Dsonar.login=MyUsername -Dsonar.password=MyPAsword -Dsonar.sources=./app/ -Dsonar.projectKey=MyProject -Dsonar.projectName=MyProject -Dsonar.projectVersion=2.9.0 '-Dsonar.exclusions=app/Vendor/**,app/Plugin/**/Test/**,app/Test/**'
SonarQube Runner 2.4
Java 1.7.0_101 Oracle Corporation (64-bit)
Linux 3.10.0-327.13.1.el7.x86_64 amd64
INFO: Runner configuration file: /usr/local/sonar-runner/conf/sonar-runner.properties
INFO: Project configuration file: /projectpath/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /projectpath/./.sonar
INFO: SonarQube Server 5.3
12:54:00.422 INFO - Load global repositories
12:54:00.927 INFO - Load global repositories (done) | time=505ms
12:54:00.988 INFO - User cache: /projectpath/.sonar/cache
12:54:01.016 INFO - Exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, buildbreaker, scmstats
12:54:01.417 INFO - Load plugins index
12:54:01.431 INFO - Load plugins index (done) | time=14ms
12:54:02.121 INFO - Found project [MyProject] cache [Thu May 19 11:29:15 CEST 2016]
12:54:02.280 INFO - Process project properties
12:54:02.723 INFO - Load project repositories
12:54:03.461 INFO - Load project repositories (done) | time=738ms
12:54:03.485 INFO - Apply project exclusions
12:54:03.629 INFO - Load quality profiles
12:54:04.348 INFO - Load quality profiles (done) | time=719ms
12:54:04.357 INFO - Load active rules
12:54:09.383 INFO - Load active rules (done) | time=5026ms
12:54:09.401 INFO - Issues mode
12:54:09.401 INFO - Scanning only changed files
12:54:09.405 INFO - ------------- Scan MyProject
12:54:10.217 INFO - Language is forced to php
12:54:10.238 INFO - Load server rules
12:54:11.104 INFO - Load server rules (done) | time=866ms
12:54:11.233 INFO - Base dir: /projectpath/workspace
12:54:11.233 INFO - Working dir: /projectpath/.sonar
12:54:11.235 INFO - Source paths: app
12:54:11.235 INFO - Source encoding: UTF-8, default locale: en_US
12:54:11.236 INFO - Index files
12:54:11.265 INFO - Excluded sources:
12:54:11.266 INFO - app/Vendor/**
12:54:11.266 INFO - app/Plugin/**/Test/**
12:54:11.266 INFO - app/Test/**
12:54:11.266 INFO - app/Test/**
12:54:11.266 INFO - Included tests:
12:54:11.266 INFO - app/Test/**
12:54:16.551 INFO - 983 files indexed
12:54:16.552 INFO - 12296 files ignored because of inclusion/exclusion patterns
12:54:16.661 INFO - Quality profile for php: Sonar way
12:54:17.180 INFO - JaCoCoSensor: JaCoCo report not found : /projectpath/target/jacoco.exec
12:54:17.183 INFO - JaCoCoItSensor: JaCoCo IT report not found: /projectpath/target/jacoco-it.exec
12:54:17.220 INFO - Sensor NoSonar and Commented out LOC Sensor
12:54:17.926 INFO - Sensor NoSonar and Commented out LOC Sensor (done) | time=706ms
12:54:17.926 INFO - Sensor Lines Sensor
12:54:18.161 INFO - Sensor Lines Sensor (done) | time=235ms
12:54:18.162 INFO - Sensor PHPSensor
12:54:18.894 INFO - 509 source files to be analyzed
12:54:28.909 INFO - 265/509 files analyzed, current file: /projectpath/MyFile.php
12:54:38.479 INFO - Sensor PHPSensor (done) | time=20317ms
12:54:38.479 INFO - Sensor PHPUnit Sensor
12:54:38.479 INFO - 509/509 source files have been analyzed
12:54:38.480 INFO - PHPUnit xml test report not found: app/junit-output.xml
12:54:38.480 INFO - PHPUnit xml unit test coverage report not found: app/clover-coverage.xml
12:54:38.480 INFO - No PHPUnit integration test coverage report provided (see 'sonar.php.coverage.itReportPath' property)
12:54:38.480 INFO - No PHPUnit overall coverage report provided (see 'sonar.php.coverage.overallReportPath' property)
12:54:38.480 INFO - Sensor PHPUnit Sensor (done) | time=1ms
12:54:38.480 INFO - Load server issues
12:54:40.752 INFO - Load server issues (done) | time=2272ms
12:54:40.753 INFO - Performing issue tracking
12:54:43.215 INFO - 1210/1210 components tracked
12:54:43.216 INFO - ANALYSIS SUCCESSFUL
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 45.188s
Final Memory: 7M/215M
INFO: ------------------------------------------------------------------------
Does anyone have any idea why this upgrade has stopped the SonarQube scanner from commenting/analyzing our pull request?
Duh, we forgot to install the github plugin on our new SonarQube instance...
The command output should include:
Starting analysis of pull request:
https://github.com/Organization/OurRepository/pull/2940
If it doesn't, you're most likely missing the github plugin.

SonarQube 5.2 - Issues not locked against custom Java rules

Using SonarQube 5.2 with Sonar-Java-Plugin 3.8, and for analysis Sonar-Runner 2.4 is used.
Plugin and java-custom examples are downloaded from git (https://github.com/SonarSource/sonar-examples/tree/master/plugins/java-custom-rules), built and deployed on server, and rules are visible on the server. Rules were activated using web under "Sonar Way" profile (which is default). A new test profile is also created and rule "Avoid Brand in method name" is added to it, and associated a project to it.
While analyzing sample java code from (/src/test/files), issues from all default java rules are locked on server, but no issue for the custom rules are locked. There are no explicit error in logs either.
sonar-runner.properties
sonar.host.url=http://localhost:9000
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar52?useUnicode=true&characterEncoding=utf8
sonar.jdbc.username=root
sonar.jdbc.password=ChangeIt
sonar.projectKey=TestSonarCustomRules
sonar.projectName=TestSonarCustomRules
sonar.projectVersion=1.0
sonar.sources=E:/Sonar Example/sonar-examples-master/plugins/java-custom-rules/src/test/files/
Here are the analysis logs:
E:\sonar-runner-2.4
SonarQube Runner 2.4
Java 1.8.0_45 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Runner configuration file: E:\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\.\.sonar
INFO: SonarQube Server 5.2
18:56:49.391 INFO - Load global repositories
18:56:49.539 INFO - Load global repositories (done) | time=145ms
18:56:49.557 WARN - Property 'sonar.jdbc.url' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
18:56:49.558 WARN - Property 'sonar.jdbc.username' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
18:56:49.558 WARN - Property 'sonar.jdbc.password' is not supported any more. There is no more DB connection to the SQ database. It will be ignored.
18:56:49.560 INFO - User cache: C:\Users\kapil.saxena\.sonar\cache
18:56:49.777 INFO - Load plugins index
18:56:49.781 INFO - Load plugins index (done) | time=4ms
18:56:49.960 INFO - Process project properties
18:56:50.209 INFO - Load project repositories
18:56:50.290 INFO - Load project repositories (done) | time=81ms
18:56:50.298 INFO - Apply project exclusions
18:56:50.369 INFO - Load quality profiles
18:56:50.401 INFO - Load quality profiles (done) | time=32ms
18:56:50.403 INFO - Load active rules
18:56:50.478 INFO - Load active rules (done) | time=75ms
18:56:50.498 WARN - SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
18:56:50.499 INFO - Publish mode
18:56:50.500 INFO - ------------- Scan TestSonarCustomRules
18:56:50.582 INFO - Load server rules
18:56:50.630 INFO - Load server rules (done) | time=48ms
18:56:50.683 INFO - Base dir: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files
18:56:50.683 INFO - Working dir: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\.sonar
18:56:50.685 INFO - Source paths: .
18:56:50.685 INFO - Source encoding: windows-1252, default locale: en_US
18:56:50.686 INFO - Index files
18:56:50.758 INFO - 7 files indexed
18:56:50.760 INFO - Quality profile for java: Kapil Test Profile
18:56:50.786 INFO - Sensor JavaSquidSensor
18:56:50.925 INFO - Configured Java source version: none
18:56:50.954 INFO - JavaClasspath initialization...
18:56:50.954 INFO - JavaClasspath initialization done: 0 ms
18:56:50.954 INFO - JavaTestClasspath initialization...
18:56:50.954 INFO - JavaTestClasspath initialization done: 0 ms
18:56:51.232 INFO - Java Main Files AST scan...
18:56:51.234 INFO - 7 source files to be analyzed
18:56:51.631 INFO - 7/7 source files have been analyzed
18:56:51.632 INFO - Java Main Files AST scan done: 400 ms
18:56:51.632 WARN - Java bytecode has not been made available to the analyzer. The org.sonar.java.bytecode.visitor.DependenciesVisitor#3a5c2626 are disabled.
18:56:51.632 INFO - Java Test Files AST scan...
18:56:51.632 INFO - 0 source files to be analyzed
18:56:51.632 INFO - Java Test Files AST scan done: 0 ms
18:56:51.632 INFO - 0/0 source files have been analyzed
18:56:51.632 INFO - Sensor JavaSquidSensor (done) | time=846ms
18:56:51.633 INFO - Sensor Lines Sensor
18:56:51.635 INFO - Sensor Lines Sensor (done) | time=2ms
18:56:51.635 INFO - Sensor QProfileSensor
18:56:51.640 INFO - Sensor QProfileSensor (done) | time=5ms
18:56:51.640 INFO - Sensor SurefireSensor
18:56:51.641 INFO - parsing E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\target\surefire-reports
18:56:51.641 ERROR - Reports path not found or is not a directory: E:\Sonar Example\sonar-examples-master\plugins\java-custom-rules\src\test\files\target\surefire-reports
18:56:51.641 INFO - Sensor SurefireSensor (done) | time=1ms
18:56:51.641 INFO - Sensor SCM Sensor
18:56:51.641 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
18:56:51.641 INFO - Sensor SCM Sensor (done) | time=0ms
18:56:51.641 INFO - Sensor Code Colorizer Sensor
18:56:51.642 INFO - Sensor Code Colorizer Sensor (done) | time=1ms
18:56:51.642 INFO - Sensor CPD Sensor
18:56:51.642 INFO - JavaCpdEngine is used for java
18:56:51.682 INFO - Sensor CPD Sensor (done) | time=40ms
18:56:51.752 INFO - Analysis reports generated in 68ms, dir size=9 KB
18:56:51.873 INFO - Analysis reports compressed in 121ms, zip size=11 KB
18:56:51.912 INFO - Analysis reports sent to server in 38ms
18:56:51.913 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/TestSonarCustomRules
18:56:51.913 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
18:56:51.913 INFO - More about the report processing at http://localhost:9000/api/ce/task?id=AVGl0nT8XJ_fdu5L48WL
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS INFO:
------------------------------------------------------------------------
Total time: 3.290s Final Memory: 14M/325M INFO:
------------------------------------------------------------------------
sonar, access and wrapper logs are all clean.
Here's image from SonarQube web showing issues for AvoidBrandInMethodNamesChecks, where all default issues are locked but issues against custom rule are not locked:
Issues for AvoidBrandInMethodNamesCheck
Any help would be appreciated.
Debug statements from custom plugin code were not executed when analysis was done with logging level at verbose/DEBUG.
The behaviour was the same when analysis was done using SonarQube 5.1 / 5.2 / 5.3 against databases default embedded H2 / PostgreSQL 9.5
Finally worked. I was using wrong version of examples. My pom.xml file of java-custom-rules did not have the following:
<dependency>
<groupId>org.sonarsource.java</groupId>
<artifactId>java-squid</artifactId>
<version>${java.plugin.version}</version>
</dependency>
Note: Get the latest version of examples.

SonarQube with Sonar-runner cannot store report

I have SonarQube 5.1 installed with sonar-runner 2.4, using Oracle database. When running sonar-runner on my project the analysis goes well and all steps until publishing the report is without problem, but then the logger gives me this:
08:04:45.705 INFO - Sensor JavaSquidSensor (done) | time=147026ms
08:04:45.705 INFO - Sensor Lines Sensor
08:04:46.007 INFO - Sensor Lines Sensor (done) | time=302ms
08:04:46.008 INFO - Sensor QProfileSensor
08:04:46.016 INFO - Sensor QProfileSensor (done) | time=8ms
08:04:46.017 INFO - Sensor InitialOpenIssuesSensor
08:04:46.363 INFO - Sensor InitialOpenIssuesSensor (done) | time=346ms
08:04:46.364 INFO - Sensor ProjectLinksSensor
08:04:46.474 INFO - Sensor ProjectLinksSensor (done) | time=110ms
08:04:46.475 INFO - Sensor VersionEventsSensor
08:04:46.908 INFO - Sensor VersionEventsSensor (done) | time=433ms
08:04:46.909 INFO - Sensor SurefireSensor
08:04:46.911 INFO - parsing /app/aim/jenkinsNew/jobs/Unit Testing with Code Coverage (DEV)/workspace/download/Omegapoint/.sonar/build/surefire-reports
08:04:46.911 WARN - Reports path not found: /app/aim/jenkinsNew/jobs/Unit Testing with Code Coverage (DEV)/workspace/download/Omegapoint/.sonar/build/surefire-reports
08:04:46.912 INFO - Sensor SurefireSensor (done) | time=3ms
08:04:46.912 INFO - Sensor SCM Sensor
08:04:46.912 INFO - No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
08:04:46.912 INFO - Sensor SCM Sensor (done) | time=0ms
08:04:46.912 INFO - Sensor CPD Sensor
08:04:46.912 INFO - JavaCpdEngine is used for java
08:04:46.915 INFO - Cross-project analysis disabled
08:04:53.913 INFO - Sensor CPD Sensor (done) | time=7001ms
08:04:53.917 INFO - No quality gate is configured.
08:04:55.523 INFO - Execute decorators...
08:05:13.250 INFO - Store results in database
08:05:39.050 INFO - Analysis reports generated in 2135ms, dir size=1 MB
08:05:42.067 INFO - Analysis reports compressed in 3016ms, zip size=927 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4:09.242s
Final Memory: 26M/230M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Fail to execute request [code=500, url=http://XXX.XXX.XXX.XXX:9010/api/computation/submit_report?projectKey=SonarCube-report]: {"errors":[{"msg":"Fail to store analysis report of project SonarCube-report"}]}
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
The server SonarQube log sonar.log gives a long output (truncated here):
2015.06.05 08:58:41 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://XXX.XXX.XXX.XXX:9010/api/computation/submit_report?projectKey=SonarCube-report
java.lang.IllegalStateException: Fail to store analysis report of project SonarCube-report
at org.sonar.server.computation.ReportQueue.add(ReportQueue.java:67) ~[sonar-server-5.1.jar:na]
at org.sonar.server.computation.ws.SubmitReportWsAction.handle(SubmitReportWsAction.java:75) ~[sonar-server-5.1.jar:na]
at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:84) ~[sonar-server-5.1.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95) ~[na:1.7.0]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:56) ~[na:1.7.0]
at java.lang.reflect.Method.invoke(Method.java:620) ~[na:2.6 (12-15-2014)]
and
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157) [na:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627) [na:1.7.0]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.0.18.jar:8.0.18]
at java.lang.Thread.run(Thread.java:863) [na:1.7.0]
Caused by: java.io.IOException: not opened for reading
at org.jruby.util.io.ChannelStream.checkReadable(ChannelStream.java:134) ~[jruby-complete-1.7.9.jar:na]
at org.jruby.util.io.ChannelStream.bufferedRead(ChannelStream.java:994) ~[jruby-complete-1.7.9.jar:na]
at org.jruby.util.io.ChannelStream.access$300(ChannelStream.java:62) ~[jruby-complete-1.7.9.jar:na]
at org.jruby.util.io.ChannelStream$InputStreamAdapter.read(ChannelStream.java:1570) ~[jruby-complete-1.7.9.jar:na]
at java.io.InputStream.read(InputStream.java:114) ~[na:1.7.0]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1792) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1769) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.IOUtils.copy(IOUtils.java:1744) ~[commons-io-2.4.jar:2.4]
at org.apache.commons.io.FileUtils.copyInputStreamToFile(FileUtils.java:1512) ~[commons-io-2.4.jar:2.4]
at org.sonar.server.computation.ReportQueue.saveReportOnDisk(ReportQueue.java:88) ~[sonar-server-5.1.jar:na]
at org.sonar.server.computation.ReportQueue.add(ReportQueue.java:61) ~[sonar-server-5.1.jar:na]
... 357 common frames omitted
I have double-checked that the database contains all sonar tables and data, and that it is reachable. Since I get this far in the process I suppose that connecting to the database is not problem? Any suggestions what to do?
Since I can't comment (need more "reputation" on stackoverflow) here's what I'm thinking:
First, I believe you're right that it isn't a database issue. This seems to be an issue with the server gathering the stored data.
So to resolve this, please check these things:
Check that your server's port 9010 is open/free while your sonar analysis is running.
Check your sonar.properties file for how you've configured the web server.
Check your wrapper.conf file
Check your access.log
Let me know what you find.
I had a similar issue on SonarQube server. Root cause was iNode count. SonarQube dir had couple of million files under its tmp directory. I deleted all the files under this tmp to free up inodes & did a restart. inode count (df -ih) then looked normal and SQ started working just fine.

sonar runner stuck at Java AST Scan

We are using sonar runner 2.3 to analyze java code.
sonar-runner gets stuck at one of our projects. The last message on the console reads Java AST Scan and process gets stuck at that..
[jsaluja#[Proj1]] ~/sonar-runner-2.3/bin/sonar-runner
SonarQube Runner 2.3
Java 1.6.0_21 Sun Microsystems Inc. (64-bit)
Linux 2.6.18-238.5.1.el5 amd64
INFO: Runner configuration file: /home/jsaluja/sonar-runner-2.3/conf/sonar-runner.properties
INFO: Project configuration file: /home/jsaluja/0809/Proj1/sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: /home/jsaluja/0809/Proj1/.sonar
INFO: SonarQube Server 3.6.2
15:53:51.076 INFO - Load batch settings
15:53:51.197 INFO - User cache: /home/jsaluja/.sonar/cache
15:53:51.201 INFO - Install plugins
15:53:52.129 INFO - Install JDBC driver
15:53:52.137 INFO - Create JDBC datasource for jdbc:oracle:thin:#1.2.3.4/XE
15:53:54.574 INFO - Initializing Hibernate
15:53:57.857 INFO - Load project settings
15:53:58.157 INFO - Apply project exclusions
15:53:58.440 INFO - ------------- Scan Module1
15:53:58.444 INFO - Load module settings
15:54:00.618 INFO - Quality profile : [name=Sonar way,language=java]
15:54:00.631 INFO - Excluded tests:
15:54:00.631 INFO - **/package-info.java
15:54:00.703 INFO - Configure Maven plugins
15:54:00.764 INFO - Compare to previous analysis
15:54:00.783 INFO - Compare over 5 days (2013-08-11)
15:54:00.796 INFO - Compare over 30 days (2013-07-17)
15:54:00.968 INFO - Base dir: /home/jsaluja/0809/Proj1/Module1
15:54:00.968 INFO - Working dir: /home/jsaluja/0809/Proj1/.sonar/a.b.c.d_Module1
15:54:00.968 INFO - Source dirs: /home/jsaluja/0809/Proj1/Module1/src
15:54:00.968 INFO - Source encoding: UTF-8, default locale: en_US
15:54:01.221 INFO - Sensor JavaSourceImporter...
15:54:11.517 INFO - Sensor JavaSourceImporter done: 10296 ms
15:54:11.518 INFO - Sensor JavaSquidSensor...
15:54:11.618 INFO - Java AST scan...
I have waited for over 2 hours.
The project structure
Proj1
Module1
Module2
sonar-project.properties
# required metadata
sonar.projectKey=a.b.c.d:Proj1
sonar.projectName=Proj1
sonar.projectVersion=1234
# List of the module identifiers
sonar.modules=Module1,Module2

C++ community plugin: Sonar-runner scans wrong file types + Lexical errors

I have setup a Sonar server and am trying to pull some metrics by setting up a test project, but I encounter some problems.
Environment:
OS: Windows Server 2008 R2 / amd64 / 6.1
App Server:Tomcat/7.0.40I, deployed the Sonar WAR file (3.5.1).
DB: MySQL v5.6.11
(relevant) Plugins:
Sonar C++ Community Plugin (0.2)
The plugin is visible under General Settings --> Sonar C++ Community Plugin
sonar-project.properties:
# Required metadata
sonar.projectKey=mistral:pmc
sonar.projectName=PMC
sonar.projectVersion=1.0
sonar.language=c++
# Comma-separated paths to directories with sources (required)
sonar.sources=e:/Development/mistral/PMC/trunk/
# Optional path to the CppCheck program required to activate some CppCheck rules
sonar.cpp.cppcheck.path=C:/Program Files (x86)/Cppcheck/cppcheck.exe
# Encoding of the source files
sonar.sourceEncoding=UTF-8
Issue 1:
When running the sonar-runner it fails as it tries to analyse irrelevant filetypes, like .DOC (see below)
C:\Users\Administrator\Documents\sonar-runner-2.2.1
Sonar Runner 2.2.1
Java 1.7.0_21 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Runner configuration file: C:\Users\Administrator\Documents\sonar-runner-2.2.1\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\Administrator\Documents\sonar-projects\PMC\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
INFO: Sonar Server 3.5.1
13:18:23.320 INFO - Load batch settings
13:18:23.429 INFO - User cache: C:\Users\Administrator\.sonar\cache
13:18:23.444 INFO - Install plugins
13:18:24.287 INFO - ------------- Executing Project Scan
13:18:24.848 INFO - Install JDBC driver
13:18:24.848 INFO - Apply project exclusions
13:18:24.864 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
13:18:25.129 INFO - Initializing Hibernate
13:18:27.563 INFO - ------------- Inspecting PMC
13:18:27.578 INFO - Load module settings
13:18:28.780 INFO - Quality profile : [name=Default C++ Profile,language=c++]
13:18:28.795 INFO - Excluded tests:
13:18:28.795 INFO - **/package-info.java
13:18:28.826 INFO - Configure Maven plugins
13:18:28.982 INFO - Compare to previous analysis (2013-05-30)
13:18:29.045 INFO - Compare over 5 days (2013-05-25, analysis of 2013-05-29 09:23:04.0)
13:18:29.092 INFO - Compare over 30 days (2013-04-30, analysis of 2013-05-29 09:23:04.0)
13:18:29.294 INFO - Base dir: C:\Users\Administrator\Documents\sonar-projects\PMC
13:18:29.294 INFO - Working dir: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
13:18:29.294 INFO - Source dirs: e:\Development\mistral\PMC\trunk
13:18:29.294 INFO - Source encoding: UTF-8, default locale: en_US
13:18:29.560 INFO - Sensor CxxSourceImporter...
13:18:30.932 WARN - SQL Error: 1366, SQLState: HY000
13:18:30.932 ERROR - Incorrect string value: '\xF2\x97\xA4\xB9\xDC\xAE...' for column 'data' at row 1
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 8.408s
Final Memory: 12M/352M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Unable to read and import the source file : 'e:\Development\mistral\PMC\trunk\doc\guides\Mistral_PMC_BroadcastEnvironmentImporter_user_guide.doc' with the charset : 'UTF-8'.
ERROR: Caused by: Unable to persist : SnapshotSource[snapshot_id=1742,data=??◄?→? > ♥ ?? ♠ ♀ ?♣ ► ?♣ ☺ ???? ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?♣ ?
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? g? ♦ ?↕?
??☼ ??☼ ??☼ ? ?§ ?§ ?" ?" 0# 0# 0# $ ???? T# T# T# P ?# ? ($ ? T# ?? ?☺ ?$ ?☻ ?' ( ?'
?' ?' ?+ j♦ ►0 l☺ |1 ? (? ☻ *? *? *? *? *? *? $ ?? ?☻ =? ?☺ N? § 0# 42 H+ H+ ^ ...]
ERROR: Caused by: org.hibernate.exception.GenericJDBCException: could not insert: [org.sonar.api.database.model.SnapshotSource]
ERROR: Caused by: could not insert: [org.sonar.api.database.model.SnapshotSource]
ERROR: Caused by: Incorrect string value: '\xF2\x97\xA4\xB9\xDC\xAE...' for column 'data' at row 1
ERROR:
ERROR: To see the full stack trace of the errors, re-run Sonar Runner with the -e switch.
ERROR: Re-run Sonar Runner using the -X switch to enable full debug logging.
When I forcefully exclude the offending file types by adding: sonar.exclusions=**/*.doc,**/*.svc to the sonar-project.properties file I can work around this problem, but I rather get it to work as expected (only take files into account as configured)
Issue 2:
The analysis throws allot of “Lexical error in file” errors while scanning (see below). I believe this might happen if the source encoding differs.
C:\Users\Administrator\Documents\sonar-projects\PMC>sonar-runner
C:\Users\Administrator\Documents\sonar-runner-2.2.1
Sonar Runner 2.2.1
Java 1.7.0_21 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Runner configuration file: C:\Users\Administrator\Documents\sonar-runner-2.2.1\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\Administrator\Documents\sonar-projects\PMC\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
INFO: Sonar Server 3.5.1
13:22:35.048 INFO - Load batch settings
13:22:35.154 INFO - User cache: C:\Users\Administrator\.sonar\cache
13:22:35.157 INFO - Install plugins
13:22:35.878 INFO - ------------- Executing Project Scan
13:22:36.471 INFO - Install JDBC driver
13:22:36.476 INFO - Apply project exclusions
13:22:36.481 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
13:22:36.730 INFO - Initializing Hibernate
13:22:38.990 INFO - ------------- Inspecting PMC
13:22:38.995 INFO - Load module settings
13:22:40.078 INFO - Quality profile : [name=Default C++ Profile,language=c++]
13:22:40.096 INFO - Excluded sources:
13:22:40.097 INFO - **/*.doc
13:22:40.097 INFO - **/*.svc
13:22:40.097 INFO - Excluded tests:
13:22:40.098 INFO - **/package-info.java
13:22:40.125 INFO - Configure Maven plugins
13:22:40.266 INFO - Compare to previous analysis (2013-05-30)
13:22:40.326 INFO - Compare over 5 days (2013-05-25, analysis of 2013-05-29 09:23:04.0)
13:22:40.366 INFO - Compare over 30 days (2013-04-30, analysis of 2013-05-29 09:23:04.0)
13:22:40.575 INFO - Base dir: C:\Users\Administrator\Documents\sonar-projects\PMC
13:22:40.575 INFO - Working dir: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
13:22:40.576 INFO - Source dirs: e:\Development\mistral\PMC\trunk
13:22:40.576 INFO - Source encoding: UTF-8, default locale: en_US
13:22:40.902 INFO - Sensor CxxSourceImporter...
13:22:42.888 INFO - Sensor CxxSourceImporter done: 1986 ms
13:22:42.889 INFO - Sensor CpdSensor...
13:22:42.889 INFO - SonarBridgeEngine is used
13:22:42.985 INFO - Cross-project analysis disabled
net.sourceforge.pmd.cpd.cppast.TokenMgrError: Lexical error in file e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ActivateItvApplicationOnMcmDistributionRequestP
essor.cs at line 1, column 1. Encountered: "\ufeff" (65279), after : ""
at net.sourceforge.pmd.cpd.cppast.CPPParserTokenManager.getNextToken(CPPParserTokenManager.java:1655)
at net.sourceforge.pmd.cpd.CPPTokenizer.tokenize(CPPTokenizer.java:26)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:60)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:52)
at org.sonar.plugins.cpd.SonarBridgeEngine.analyse(SonarBridgeEngine.java:102)
at org.sonar.plugins.cpd.CpdSensor.analyse(CpdSensor.java:80)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.Phases.execute(Phases.java:101)
at org.sonar.batch.scan.ScanContainer.doStart(ScanContainer.java:147)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:49)
at org.sonar.batch.bootstrap.TaskContainer.doStart(TaskContainer.java:188)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:75)
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.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
at org.sonar.runner.api.Runner.execute(Runner.java:89)
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:41)
Skipping e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ActivateItvApplicationOnMcmDistributionRequestProcessor.cs due to parse error
net.sourceforge.pmd.cpd.cppast.TokenMgrError: Lexical error in file e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ApplicationDistributionRequestProcessor.cs at l
1, column 1. Encountered: "\ufeff" (65279), after : ""
at net.sourceforge.pmd.cpd.cppast.CPPParserTokenManager.getNextToken(CPPParserTokenManager.java:1655)
at net.sourceforge.pmd.cpd.CPPTokenizer.tokenize(CPPTokenizer.java:26)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:60)
at org.sonar.duplications.internal.pmd.TokenizerBridge.chunk(TokenizerBridge.java:52)
at org.sonar.plugins.cpd.SonarBridgeEngine.analyse(SonarBridgeEngine.java:102)
at org.sonar.plugins.cpd.CpdSensor.analyse(CpdSensor.java:80)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.Phases.execute(Phases.java:101)
at org.sonar.batch.scan.ScanContainer.doStart(ScanContainer.java:147)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:49)
at org.sonar.batch.bootstrap.TaskContainer.doStart(TaskContainer.java:188)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
at org.sonar.batch.bootstrap.Container.start(Container.java:72)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:75)
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.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
at org.sonar.runner.api.Runner.execute(Runner.java:89)
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:41)
Skipping e:\Development\mistral\PMC\trunk\AppServer\ApplicationDistributionScheduler\Logic\ApplicationDistributionRequestProcessor.cs due to parse error
The thing is, I have set the sourceEncoding to UTF-8 but the files throwing the error are also encoded in UTF-8 (see below):
These might be simple beginner errors but I cannot find a quick/easy fix for this. Could you help on my way?
The .doc file is scanned because its file name ends with 'c'.
The c++ plugin's default source suffixes are: cxx,cpp,cc,c
Notice that there isn't any dot '.' character in there. So any file whose file name ends with 'c' character will be taken: abc, ab.c, a.bc. The same apply for the other suffixes.
If you want exact suffixes, you need to use something like this:
sonar.cxx.suffixes.sources=.cxx,.cpp,.cc,.c

Resources