ERROR: Error during SonarQube Scanner execution: NullPointerException

Hello,

Jenkins plugin - SonarScanner

图片

got the following exception :

11:10:11.935 DEBUG: 'src/main/java/com/zhnf/main/company/service/IMyCResumeLogService.java' generated metadata with charset 'UTF-8'
11:10:11.985 DEBUG: 'src/main/java/com/zhnf/main/company/service/IMyCTracerService.java' generated metadata with charset 'UTF-8'
11:10:12.113 INFO: ------------------------------------------------------------------------
11:10:12.113 INFO: EXECUTION FAILURE
11:10:12.113 INFO: ------------------------------------------------------------------------
11:10:12.114 INFO: Total time: 2:06.625s
11:10:12.406 INFO: Final Memory: 28M/859M
11:10:12.406 INFO: ------------------------------------------------------------------------
11:10:12.406 ERROR: Error during SonarQube Scanner execution
org.sonar.java.AnalysisException: SonarQube is unable to analyze file : 'src/main/java/com/zhnf/main/company/service/IMyCTracerService.java'
	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:108)
	at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:65)
	at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:111)
	at org.sonar.java.JavaSquid.scan(JavaSquid.java:105)
	at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:88)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:400)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:395)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:358)
	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 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	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:185)
	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
	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)
Caused by: java.lang.NullPointerException
	at org.sonar.java.model.JSymbol.variableEnclosingClass(JSymbol.java:379)
	at org.sonar.java.model.JSymbol.enclosingClass(JSymbol.java:340)
	at org.sonar.java.checks.security.StandardInputReadCheck.checkIdentifier(StandardInputReadCheck.java:65)
	at org.sonar.java.checks.security.StandardInputReadCheck.visitNode(StandardInputReadCheck.java:60)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.lambda$visit$7(VisitorsBridge.java:271)
	at java.util.ArrayList.forEach(ArrayList.java:1257)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visit(VisitorsBridge.java:274)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visitChildren(VisitorsBridge.java:256)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visit(VisitorsBridge.java:278)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visitChildren(VisitorsBridge.java:256)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visit(VisitorsBridge.java:278)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visitChildren(VisitorsBridge.java:256)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visit(VisitorsBridge.java:278)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visitChildren(VisitorsBridge.java:256)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.visit(VisitorsBridge.java:278)
	at org.sonar.java.model.VisitorsBridge$ScannerRunner.run(VisitorsBridge.java:247)
	at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:137)
	at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:99)
	... 34 more
WARN: Unable to locate 'report-task.txt' in the workspace. Did the SonarScanner succeeded?

I had try to use another version of SonarQube Scanner plugin , but got the same result.
Do you know how to solve this problem?
thanks a lot

Hi,

Welcome to the community!

What version of SonarQube are you using? Also, do you know if your server has been upgraded to use version 6 of the Java analyzer?

 
Thx,
Ann

The version of SonarQube is Community Edition V7.9.2 (build 30863).
And the Java analyzer had been upgraded to version 6

thanks

Hey @faklyn_ng,

could you please provide a code snippet which compiles and produce the issue, when analyzing the code? Without it, it will be extremely hard to reproduce the issue and identify the root cause.

Thanks,
Michael