# java.lang.IllegalStateException : The "build-wrapper-dump.json" file was found empty

**URL:** <https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819>\
**Category:** SonarQube Server / Community Build\
**Tags:** sonarqube, sonarqube-cloud, scanner\
**Created:** [November 9, 2022, 10:52am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819 "2022-11-09T10:52:00Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [November 9, 2022, 10:52am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/1 "2022-11-09T10:52:00Z")

</div>

Hello everyone, I have a problem.

I am using Windose 7, compiler for CCS 3.3 using TI 2000 for SonarCloud.  
Last time I failed to compile due to using the wrong compiler, and now I am still getting the same error as before after changing to the above compiler.  
Here are the problems I encountered.

```auto
17:45:58.818 INFO: 0/114 files marked as unchanged
17:45:58.819 INFO: Cache: 0/0 hits, 125 bytes
17:45:58.820 INFO: 0 compilation units analyzed
17:45:59.547 INFO: ------------------------------------------------------------------------
17:45:59.548 INFO: EXECUTION FAILURE
17:45:59.551 INFO: ------------------------------------------------------------------------
17:45:59.552 INFO: Total time: 1:25.570s
17:45:59.881 INFO: Final Memory: 39M/134M
17:45:59.881 INFO: ------------------------------------------------------------------------
17:45:59.882 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The "build-wrapper-dump.json" file was found empty. Please make sure that:
  * you are using the latest version of the build-wrapper and the CFamily analyzer
  * your compiler is supported
  * you are wrapping your build correctly
  * you are wrapping a full/clean build
  * if you are building your project inside a Docker container, build-wrapper is wrapping the build process inside the container and not wrapping the external Docker process
        at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:484)
        at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:212)
        at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
        at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
        at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
        at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:468)
        at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:464)
        at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:420)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
        at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:130)
        at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
        at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
        at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
        at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

```

I can provide files for build-wrapper.log, build-wrapper-dump.json, SonarCloud.bat  
I hope this problem can be solved.  
Thank you in advance.

```auto
type or paste code here

```

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 16, 2022, 12:56pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/4 "2022-11-16T12:56:35Z")

</div>

Hello @EDChang, and thanks for your patience,

> [@EDChang](#):
>
> I can provide files for build-wrapper.log, build-wrapper-dump.json, SonarCloud.bat

Yes, that would be helpful. If you feel these files contain sensitive data, I can send you a private message to share them privately.

Could you also share which exact command you used to execute the build wrapper and the scanner?

Thanks

---

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [November 17, 2022, 8:46am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/5 "2022-11-17T08:46:19Z")

</div>

Hello Marco !

Can you give me a PM?

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 17, 2022, 9:41am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/6 "2022-11-17T09:41:55Z")

</div>

Sure, I just did.

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 21, 2022, 10:32am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/7 "2022-11-21T10:32:16Z")

</div>

Thanks, @EDChang, for sharing the files with me.

I’m not familiar with the build process for C2000, but here are things you should be able to check:

- Is the command in `sonarCloud.bat` doing a clean build? All files must be compiled for build-wrapper to see the compiler invocations and record the necessary information for the analysis.
- It seems [other people](https://community.sonarsource.com/t/jenkins-sonar-scanner-of-c-project-only-showing-0-compilation-units-analyzed-for-sonarcfamily/6134/3) use `eclipsec.exe` to build C2000 projects from the command line. I also found [this documentation](https://software-dl.ti.com/ccs/esd/documents/ccs_projects-command-line.html) about `eclipsec.exe`, but you may have to upgrade your CCS version.
- If you figure out how to do a clean build with CCS 3.3, it is possible build-wrapper may still not work. In that case, I would encourage you to upgrade if you can since this version wasn’t updated since 2009.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [November 22, 2022, 1:23am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/8 "2022-11-22T01:23:16Z")

</div>

Umm. Sorry can you explain more clearly, what is “clean build”.  
I see more different compiler have different “clean build” write method,  
How do I know how to write “Clean build” in CCS or eclipsec ?  
your recommendation, I will discuss with my supervisor.  
Tks. marco.

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 23, 2022, 9:40am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/9 "2022-11-23T09:40:39Z")

</div>

Hi @EDChang

By clean build, I mean all intermediate and output files were deleted, leaving only the project and component files before doing the actual build. The exact process depends on the build tools. You can find some examples in [our documentation](https://docs.sonarqube.org/latest/analysis/languages/cfamily/#header-5), but they are not specific to CCS. Unfortunately, I’m unfamiliar with CCS to provide a solution that works out of the box. But the documentation I shared previously for modern CCS versions should cover this.

HTH

---

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [November 25, 2022, 7:09am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/10 "2022-11-25T07:09:39Z")

</div>

HI marco,

I listened to your advice, up CCS3 to CCS7, the CMD have show “analysis success”.  
but why my sonarcloud didn’t analysis results are displayed?

Can You Cheak again my build-wapper.log and build-wapper-dump.json ?

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 28, 2022, 8:06am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/11 "2022-11-28T08:06:07Z")

</div>

Hi @EDChang,

I’m glad you could make some progress on the issue. Let’s try to figure out the rest.

To fully understand what you mean, could you share the `build-wapper.log` and `build-wapper-dump.json` and the entire output from the scanner invocation? You can use the same private thread if you think sensitive data is in those files.

Cheers,

---

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [November 29, 2022, 7:53am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/12 "2022-11-29T07:53:37Z")

</div>

Hello Marco

I am sorry, I can not find you give my PM, So the `build-wapper.log`and “build-wapper-dump.json” , I put it here.

[build-wrapper-dump.txt](https://community.sonarsource.com/uploads/short-url/41ruxhHpAtr0xsjemSnGsUmUGko.txt) (512.4 KB)  
[build-wrapper.log](https://community.sonarsource.com/uploads/short-url/6M9VV7AKCzSPJFNNkz2RAOeGI5N.log) (1.3 MB)

Thanks you, you help me to Solution my question.  
Have a nice day to you.

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 29, 2022, 10:31am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/13 "2022-11-29T10:31:02Z")

</div>

Hi @EDChang

Thanks for the files. I see the build wrapper database looks better now.

However, I also need the entire output from the scanner invocation to understand the issue you’re facing. You can find the instructions to run the scanner with the build wrapper output on this page: [Analysis Steps Using Build Wrapper](https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/#analysis-steps-using-build-wrapper).

HTH

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [November 30, 2022, 12:47pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/14 "2022-11-30T12:47:11Z")

</div>

Hi @EDChang,

Thanks for sharing the logs privately.

Looking at them, I see you run the scanner from the TI installation directory and that your project lives in a subdirectory on your desktop. This is not compatible with the instruction to run the scanner:

> - Execute the SonarScanner (`sonar-scanner`) from the root directory of your project.

You will find other similar requirements on the page I linked previously. The best would be to run both the build wrapper and the scanner from the root of your project. This simplifies how you can refer to the build wrapper output in your `sonar-project.properties` since the path has to be relative.

You can also find information on how the analysis scope can be defined and how this impacts the selection of files to analyze here:

- [Language-Specific Properties](https://docs.sonarcloud.io/advanced-setup/languages/c-c-objective-c/#language-specific-properties)
- [https://docs.sonarcloud.io/advanced-setup/analysis-scope/](https://docs.sonarcloud.io/advanced-setup/analysis-scope/)

HTH

---

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [December 1, 2022, 2:29am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/15 "2022-12-01T02:29:53Z")

</div>

Hello marco,

Thank you for teaching me the importance of location.  
I have put my code in the same folder as sonar-project.properties, and after several attempts, I have the same fault, and at the end of the analysis it runs the following fault.

An error occurred while analyzing the following compilation unit:  
C:/ti/ccsv7/eclipse/36-004153-01G/1.Source Code/MAX8k\_28066/Debug/…/APP/BusBatProt.C  
A file named “sonar-cfamily-reproducer.zip” has been generated to help the problem investigation.  
Please contact SonarSource support providing the following file to help improving the analyzer:  
C:\ti\ccsv7\eclipse\sonar-cfamily-reproducer.zip

The "sonar-cfamily-reproducer.zip " I have sent it to you from the PM.

Sorry my questions are very many and complicated, and my English is not that good, it takes a little time to understand, thank you again for helping me solve the problem!

---

<div class="post-metadata">

**Author:** ![marco.b](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/marco.b/32/25371_2.png) [@marco.b](https://community.sonarsource.com/u/marco.b)\
**Post date:** [December 7, 2022, 9:40am UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/17 "2022-12-07T09:40:58Z")

</div>

Hi @EDChang, and thanks for your patience.

I finally had the time to look at the files you shared.

There are a few things worth sharing here. First, there’s this warning:

```auto
09:54:27.032390100 WARN 
File
  [path]\build-wrapper-dump.json
was generated using build-wrapper version 6.38,
which does not match the analyzer version 6.39.0.60440.

Please download the matching version from the server
  https://sonarcloud.io/static/cpp/build-wrapper-win-x86.zip

```

I recommend regenerating the build wrapper output with the mentioned version. While it will not address your current problem, this will avoid other unrelated issues in the future.

The other thing is on our side: unfortunately, at the moment, the error message is not clear, and we need to improve it. Essentially, you are still using a fairly old version (CCS v7 was released more than 5 years ago if I’m not mistaken) that we don’t support. With [[CPP-3940] - Jira](https://sonarsource.atlassian.net/browse/CPP-3940), we aim at improving the error message, but that ticket doesn’t aim at supporting that old compiler version.

We also have [[CPP-3986] - Jira](https://sonarsource.atlassian.net/browse/CPP-3986) to record requests to support older compiler versions.

Thankfully, I believe upgrading to a recent version of CCS (and thus a supported version of the compiler for C2000) should resolve your issues.

I hope this helps, and do let me know if you face other issues.

---

<div class="post-metadata">

**Author:** ![EDChang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/edchang/32/38589_2.png) [@EDChang](https://community.sonarsource.com/u/EDChang)\
**Post date:** [December 8, 2022, 12:04pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/18 "2022-12-08T12:04:51Z")

</div>

Hi Marco !!

I’ve read your reply and I think I will discuss with my supervisor again whether to use the newer CCS version or not, for now it should just be a change of version and everything will run smoother after that!

Thank you for your help this period, I have learned a few things.

Have a nice day.

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [May 20, 2025, 2:58pm UTC](https://community.sonarsource.com/t/java-lang-illegalstateexception-the-build-wrapper-dump-json-file-was-found-empty/75819/20 "2025-05-20T14:58:40Z")

</div>

Hey @EDChang,

If you didn’t see – last year we introduced support in SonarQube Server for a feature called C/C++ AutoConfig! Removing the question of supported compiler altogether.

> [@C and C++ AutoConfig for SonarQube](https://community.sonarsource.com/t/c-and-c-autoconfig-for-sonarqube/117344):
>
> We have big news for our dear C and C++ SonarQube users. Configuring the analysis requires some skills; at times, it can get technical and tedious, with a few known caveats. We unleashed the talent of our mighty engineers, and they made our C and C++ analyzer smart enough to configure itself. Hence the name AutoConfig. As a result: No need to worry about compiler support No need to worry about build-wrapper or compilation database No need to know anything about the project to configure, nor C…

This is available in SonarQube Server _v10.6+_, although you should really target at least _v2025.1_.
