SonarCloud analysis failed with NullPointerException

Since January 7, 2020, all our Jenkins build are failing on the Sonar analysis step, always on the same Java test class.

We’re using SonarCloud, we haven’t modified the file since October, and the error log is : SonarQube is unable to analyze file : '...'

Caused by: java.lang.NullPointerException at org.eclipse.jdt.core.dom.DefaultBindingResolver.lookupEnvironment(
	at org.eclipse.jdt.core.dom.ASTUtils.mayTolerateMissingType(

I can’t give you any reproduction step, but maybe I can give some piece of code to help you ?

Hello @Helayxa,

Thanks for the feedback. It is most probably related to the update of SonarCloud from SonarJava version 5.14 to 6.0 (and now 6.0.1).

In order to help you, could you share the test class code? You can send it to me privately if needed.
If you also manage to reduce the case to a small self-contained reproducer (without dependencies to code outside of the JDK), it would also help quite a lot.

  • Is this test class particularly different from others?
  • Is it the first test class to be analyzed which fails, or it is in the middle of the analysis?
  • Which scanner are you using for your analysis? (maven / gradle / sonar-scanner)

As a temporarily workaround, I would advise to temporarily exclude the test class from analysis, while we are investigating the issue and trying to reproduce it on our side.


Hi @Michael

Thanks a lot for your answer !
I’m still investigating about this issue (to give you the maximum of reproduction informations), but I can’t publish some code here. How can I contact you privately to give it to you ?

Thanks a lot.

I sent you a private message regarding this :slight_smile: