Error running sonarqube - ERROR: Error during SonarScanner execution java.lang.IllegalAccessError

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube Version 9

  • what are you trying to achieve
    I got this error when running,


ERROR: Error during SonarScanner execution
java.lang.IllegalAccessError: class org.sonarsource.scala.checks.DuplicateBranchScalaCheck$$Lambda$2646/0x0000000801986600 tried to access protected method 'boolean org.sonarsource.slang.checks.DuplicateBranchCheck.spansMultipleLines(org.sonarsource.slang.api.Tree)' (org.sonarsource.scala.checks.DuplicateBranchScalaCheck$$Lambda$2646/0x0000000801986600 and org.sonarsource.slang.checks.DuplicateBranchCheck are in unnamed module of loader org.sonar.classloader.ClassRealm @71cf1b07)
    at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
    at java.base/java.util.stream.SliceOps$1$1.accept(SliceOps.java:199)
    at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at org.sonarsource.scala.checks.DuplicateBranchScalaCheck.checkDuplicatedBranches(DuplicateBranchScalaCheck.java:50)
    at org.sonarsource.slang.checks.AbstractBranchDuplicationCheck.checkConditionalStructure(AbstractBranchDuplicationCheck.java:57)
    at org.sonarsource.slang.checks.AbstractBranchDuplicationCheck.lambda$initialize$1(AbstractBranchDuplicationCheck.java:49)
    at org.sonarsource.slang.plugin.ChecksVisitor$ContextAdapter.lambda$register$0(ChecksVisitor.java:68)
    at org.sonarsource.slang.visitors.TreeVisitor$ConsumerFilter.accept(TreeVisitor.java:87)
    at org.sonarsource.slang.visitors.TreeVisitor$ConsumerFilter.access$000(TreeVisitor.java:74)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:50)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.util.Collections$SingletonList.forEach(Collections.java:4933)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.lambda$visit$0(TreeVisitor.java:53)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.sonarsource.slang.visitors.TreeVisitor.visit(TreeVisitor.java:53)
    at org.sonarsource.slang.visitors.TreeVisitor.scan(TreeVisitor.java:40)
    at org.sonarsource.slang.plugin.SlangSensor.lambda$analyseFile$1(SlangSensor.java:129)
    at org.sonarsource.slang.plugin.DurationStatistics.time(DurationStatistics.java:64)
    at org.sonarsource.slang.plugin.SlangSensor.analyseFile(SlangSensor.java:129)
    at org.sonarsource.slang.plugin.SlangSensor.analyseFiles(SlangSensor.java:91)
    at org.sonarsource.slang.plugin.SlangSensor.execute(SlangSensor.java:166)
    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:79)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:382)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:378)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:347)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
    at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
    at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
    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(NativeMethodAccessorImpl.java:64)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    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)

  • what have you tried so far to achieve this
    Nothing further.

Hello @Chew_Thiam_Soon

I know it’s an old topic, but I was wondering if you are still facing this issue? If you manage to solve it, it would be great to share with us what was the problem.

If not, we definitely need more context and information in order to help you.

Best,
Quentin