atom feed11 messages in org.codehaus.sonar.userRe: [sonar-user] [sonar-runner] Sonar...
FromSent OnAttachments
Marc VerwerftMar 8, 2012 5:43 am 
Freddy MalletMar 9, 2012 2:10 am 
Marc VerwerftMar 12, 2012 1:29 am 
Evgeny MandrikovMar 12, 2012 1:38 am 
Marc VerwerftMar 12, 2012 2:21 am 
Dinesh BolkensteynMar 12, 2012 3:25 am 
Marc VerwerftMar 12, 2012 3:46 am 
Freddy MalletMar 12, 2012 7:28 am 
Marc VerwerftMar 12, 2012 7:59 am 
Evgeny MandrikovMar 12, 2012 8:19 am 
Tomasz HopekAug 10, 2012 8:04 am 
Subject:Re: [sonar-user] [sonar-runner] SonarException: Unable to read and import ... - identical filenames?
From:Evgeny Mandrikov (
Date:Mar 12, 2012 1:38:18 am

Hi guys,

Indeed due to chains of exceptions in Sonar it's hard to distinguish two cases :

1. source encoding problem 2. files with same name in same namespace

And in order to distinguish them - you should take a look (or provide for us) full stack-strace of error, which will contain root cause explaining problem.

On Mon, Mar 12, 2012 at 12:29, Marc Verwerft <>wrote:

Hello Freddy,

I've pursuited your reasoning and tried figuring out any differences in encoding or dos/unix style between the files and others that can be handled by sonar. I found none. Then I concluded I needed a test. So I've created 2 identical named EMPTY files in 2 directories. And I get the same error - so I think this proves it must be due to the identical filenames ...

So I don't think I can fix this with the sourceEncoding setting ... Thanks for the reply though.

On Fri, Mar 9, 2012 at 11:10 AM, Freddy Mallet <>wrote:

Hi Marc,

By default, Sonar uses the charset of the machine used to execute the Sonar batch. To override this default charset (which seems to be necessary in your case), you should use the property 'sonar.sourceEncoding'.

Kind regards, Freddy

----- Sonar for Continuous Inspection

On Thu, Mar 8, 2012 at 2:43 PM, Marc Verwerft <



Just yesterday I installed SonarSource with sonar-runner and was trying to use it for C analysis with the latest C plugin (1.4).

Unfortunately, I bumped into the first hurdle: Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: Unable to read and import the source file : '/home/marc/projects/MyProject/srcs/LATEST/fw/tiny_mq/src/mp_transport.c' with the charset : 'UTF-8'. at org.sonar.runner.Runner.delegateExecution( at org.sonar.runner.Runner.execute( at org.sonar.runner.Main.main( Caused by: org.sonar.api.utils.SonarException: Unable to read and import the source file : '/home/marc/projects/MyProject/srcs/LATEST/fw/tiny_mq/src/mp_transport.c' with the charset : 'UTF-8'. at org.sonar.api.batch.AbstractSourceImporter.parseDirs( at org.sonar.api.batch.AbstractSourceImporter.analyse( at org.sonar.api.batch.AbstractSourceImporter.analyse( at org.sonar.batch.phases.SensorsExecutor.execute( ...

This seems related to an already known 'problem' albeit in the PHP plugin !!! If sonar-runner finds an identical filename under 2 different subdirectories the above exception is generated. I have: $ find . -name mp_transport.c ./fw/transport/src/mp_transport.c ./fw/tiny_mq/src/mp_transport.c

See also

Is this a known error? Should I add comments somewhere?