NullPointerException -> Unable to create symbol table (SonarQube Community Version 5.6.4)

My code is built using Apache Maven 3.6.3 and Java version: 11.0.2
For Code analysis we are using sonar-scanner-cli-3.2.0.1227 in Jenkins (v 2.249.3) and SonarQube Server Version 5.6.4 with ‘Java Code Quality and Security plugin’ version 4.4.0.8066

We are getting following error in many of our Java files :

[ERROR] Unable to create symbol table for : /home/gdevopsc/jenkins-eu/workspace/TROY/TROYKR/TROYKR_SOANRQUBE/gateway-static-enricher/src/test/java/com/nomura/cts/troykr/gateway/takaraEnricher/collateral/CollateralPartyEnricherTest.java
java.lang.IllegalArgumentException: null
at org.objectweb.asm.ClassReader.(ClassReader.java:170) ~[na:na]
at org.objectweb.asm.ClassReader.(ClassReader.java:153) ~[na:na]
at org.objectweb.asm.ClassReader.(ClassReader.java:424) ~[na:na]
at org.sonar.java.resolve.BytecodeCompleter.loadClass(BytecodeCompleter.java:221) ~[na:na]
at org.sonar.java.resolve.Symbols.(Symbols.java:176) ~[na:na]
at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:55) ~[na:na]
at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:105) ~[na:na]
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:84) ~[na:na]
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:67) ~[na:na]
at org.sonar.java.JavaSquid.scanTests(JavaSquid.java:120) ~[na:na]
at org.sonar.java.JavaSquid.scan(JavaSquid.java:109) ~[na:na]
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:87) ~[na:na]
at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79) ~[sonar-scanner-engine-shaded-5.6.4.jar:na]
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) ~[sonar-scanner-api-batch9061841880648394895.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) ~[sonar-scanner-api-2.14.0.2002.jar:na]
at com.sun.proxy.$Proxy25.execute(Unknown Source) ~[na:na]
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) ~[sonar-scanner-api-2.14.0.2002.jar:na]
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) ~[sonar-scanner-api-2.14.0.2002.jar:na]
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:65) ~[sonar-maven-plugin-3.7.0.1746.jar:na]
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:104) ~[sonar-maven-plugin-3.7.0.1746.jar:na]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) ~[maven-core-3.6.3.jar:3.6.3]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957) ~[maven-embedder-3.6.3.jar:3.6.3]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289) ~[maven-embedder-3.6.3.jar:3.6.3]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193) ~[maven-embedder-3.6.3.jar:3.6.3]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) ~[plexus-classworlds-2.6.0.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) ~[plexus-classworlds-2.6.0.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) ~[plexus-classworlds-2.6.0.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) ~[plexus-classworlds-2.6.0.jar:na]

Please help with a solution

Hey there.

SonarQube v5.6 LTS is very, very old at this point. It’s EOL was April 2018. You’re not going to find many people who can help you. You need to upgrade immediately. Your upgrade path is:

5.6.4 -> 6.7.7 -> 7.9.4 (current LTS) -> 8.5.1 (this last step is optional)

If your problem persists after upgrade, please come back to us.

Thanks Colin ! We are doing a new setup with 7.9.5 (Latest LTS) version…

Will this issue be resolved in the same ?

No idea! You’re getting a very generic error, and our Java analyzer has been rewritten a few times sincec the version you’re using :laughing:

Please test analysis against the new instance (make sure you also upgrade your Java analyzer through the Marketplace to the latest version compatible with SonarQube v7.9 LTS) and let us know if you still face the issue.