-1

I am getting null pointer exception after executing sonar-scanner.bat file in windows terminal for java mutliple application. I added path in sonar-scanner

INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 25.283s INFO: Final Memory: 15M/57M INFO: ------------------------------------------------------------------------ ERROR: Error during SonarScanner execution java.lang.NullPointerException at org.sonarsource.scm.git.GitScmProviderBefore77.revisionId(GitScmProviderBefore77.java:173) at org.sonar.scanner.scm.ScmRevisionImpl.get(ScmRevisionImpl.java:62) at org.sonar.scanner.report.MetadataPublisher.addScmInformation(MetadataPublisher.java:153) at org.sonar.scanner.report.MetadataPublisher.publish(MetadataPublisher.java:105) at org.sonar.scanner.report.ReportPublisher.generateReportFile(ReportPublisher.java:152) at org.sonar.scanner.report.ReportPublisher.execute(ReportPublisher.java:138) at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:366) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122) at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122) at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67) 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:126) at org.sonarsource.scanner.cli.Main.execute(Main.java:81) at org.sonarsource.scanner.cli.Main.main(Main.java:62) ERROR: ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

I am using below given version of sonarqube and sonarscanner. sonarqube-7.8 sonar-scanner-cli-4.8.0.2856-windows

I am trying to get the testing report for my application in SonarQube(localhost :9000).

Any help is appreciated, and if there is more information needed I will provide it.

Thanks.

borchvm
  • 3,533
  • 16
  • 44
  • 45

1 Answers1

0

The scanner fails if it can’t find a HEAD reference when running a scan with git. Can you try commit something and try this again? Alternatively, if there is no HEAD, just specify -Dsonar.scm.disabled=true.

Source: https://community.sonarsource.com/t/nullpointerexception-when-running-scan/15598/4

davyioner
  • 111
  • 1
  • 9
  • I have no idea about HEAD reference and I am trying to test by using sonarqube locally before pushing in git. I am adding Dsonar. scm.disabled=true inside sonar-scanner.properties file.Could u provide us with more references or an easy way for running properly in local – Nidhi Singh Feb 16 '23 at 13:40