声纳分析失败无法创建符号 table
Sonar fails on analysis Unable to create symbol table for
当我 运行 使用 SonarQube 5.0.1 进行分析时,我收到以下异常
在 java 来源
我运行通过运行以下命令对 Maven 项目进行此分析:
mvn sonar:sonar -Psonar
请帮助 Gidi
[22:04:35]: [ERROR] [22:04:35.535] Class not found: javafx.beans.Observable
[22:04:35]: [ERROR] [22:04:35.884] Class not found: javafx.beans.Observable
[22:04:36]: [ERROR] [22:04:36.403] Class not found: javafx.beans.Observable
[22:04:37]: [ERROR] [22:04:37.014] Unable to create symbol table for : /home/ciuser/buildAgent/work/f9bff052f3e7989d/cobrowse-server/cobrowse-server-core/src/main/java/net/synchronite/common/ImmutableCollectors.java
[22:04:37]: java.lang.IllegalStateException: Type not resolved methodReference tokenValue='ImmutableMap' tokenLine=31 tokenColumn=62
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:275) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:241) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:234) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.visitVariable(TypeAndReferenceSolver.java:453) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.declaration.VariableTreeImpl.accept(VariableTreeImpl.java:180) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:36) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBlock(BaseTreeVisitor.java:85) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.statement.BlockTreeImpl.accept(BlockTreeImpl.java:91) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.visitMethod(TypeAndReferenceSolver.java:108) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.declaration.MethodTreeImpl.accept(MethodTreeImpl.java:201) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:36) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.visitClass(TypeAndReferenceSolver.java:117) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.declaration.ClassTreeImpl.accept(ClassTreeImpl.java:201) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:36) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitCompilationUnit(BaseTreeVisitor.java:55) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:66) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:111) ~[java-squid-2.8.jar:na]
[22:04:37]: at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:67) [sslr-core-1.20.jar:na]
[22:04:37]: at org.sonar.java.ast.AstScanner.simpleScan(AstScanner.java:107) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.ast.AstScanner.scan(AstScanner.java:75) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:122) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.JavaSquid.scan(JavaSquid.java:115) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:91) [sonar-java-plugin-2.8.jar:na]
[22:04:37]: at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:122) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) [sonar-runner-batch7101932206275395209.jar:na]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
[22:04:37]: at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.delegateExecution(BatchLauncher.java:87) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.run(BatchLauncher.java:75) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_11]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.api.Runner.execute(Runner.java:100) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135) [sonar-maven-plugin-2.5.jar:na]
[22:04:37]: at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:138) [sonar-maven-plugin-2.5.jar:na]
[22:04:37]: at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) [maven-embedder-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) [maven-embedder-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [maven-embedder-3.0.4.jar:3.0.4]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
[22:04:37]: at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [plexus-classworlds-2.4.jar:na]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [plexus-classworlds-2.4.jar:na]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [plexus-classworlds-2.4.jar:na]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [plexus-classworlds-2.4.jar:na]
您遇到了以下问题:
http://jira.codehaus.org/browse/SONARJAVA-876
基本上,方法引用表达式的类型没有解析也没有设置。因此,您会遇到此非法状态异常,因为表达式应始终具有类型。
从您的日志可以看出,您使用的是sonar-java插件版本2.8,请将您的插件更新到最新版本以解决您的问题。
我也遇到过类似的问题。这是因为 java 版本不兼容,正如@Ahmed Ashour 在之前的回答中所说。在我们的 SonarQube 门户中,在 Administration => Marketplace => 下更新 SonarJava 插件 => 搜索 SonarJava 并将其更新到最新版本。然后重启SonarQube。
Screenshot for your reference
在 Eclipse 中右键单击项目-->属性-->Java构建路径-->库选项卡-->JRE 系统库并单击编辑按钮。
单击备用 JRE-->已安装的 JRE--->搜索
导航到 Java 安装的文件夹和 select
[C:\Program Files\Java\jdk1.8.0_281]
点击应用并运行你的项目
当我 运行 使用 SonarQube 5.0.1 进行分析时,我收到以下异常 在 java 来源
我运行通过运行以下命令对 Maven 项目进行此分析: mvn sonar:sonar -Psonar 请帮助 Gidi
[22:04:35]: [ERROR] [22:04:35.535] Class not found: javafx.beans.Observable
[22:04:35]: [ERROR] [22:04:35.884] Class not found: javafx.beans.Observable
[22:04:36]: [ERROR] [22:04:36.403] Class not found: javafx.beans.Observable
[22:04:37]: [ERROR] [22:04:37.014] Unable to create symbol table for : /home/ciuser/buildAgent/work/f9bff052f3e7989d/cobrowse-server/cobrowse-server-core/src/main/java/net/synchronite/common/ImmutableCollectors.java
[22:04:37]: java.lang.IllegalStateException: Type not resolved methodReference tokenValue='ImmutableMap' tokenLine=31 tokenColumn=62
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:275) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:241) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.resolveAs(TypeAndReferenceSolver.java:234) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.visitVariable(TypeAndReferenceSolver.java:453) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.declaration.VariableTreeImpl.accept(VariableTreeImpl.java:180) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:36) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitBlock(BaseTreeVisitor.java:85) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.statement.BlockTreeImpl.accept(BlockTreeImpl.java:91) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.visitMethod(TypeAndReferenceSolver.java:108) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.declaration.MethodTreeImpl.accept(MethodTreeImpl.java:201) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:36) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.TypeAndReferenceSolver.visitClass(TypeAndReferenceSolver.java:117) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.declaration.ClassTreeImpl.accept(ClassTreeImpl.java:201) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:42) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.scan(BaseTreeVisitor.java:36) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.api.tree.BaseTreeVisitor.visitCompilationUnit(BaseTreeVisitor.java:55) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:66) ~[java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:111) ~[java-squid-2.8.jar:na]
[22:04:37]: at com.sonar.sslr.impl.ast.AstWalker.walkAndVisit(AstWalker.java:67) [sslr-core-1.20.jar:na]
[22:04:37]: at org.sonar.java.ast.AstScanner.simpleScan(AstScanner.java:107) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.ast.AstScanner.scan(AstScanner.java:75) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:122) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.java.JavaSquid.scan(JavaSquid.java:115) [java-squid-2.8.jar:na]
[22:04:37]: at org.sonar.plugins.java.JavaSquidSensor.analyse(JavaSquidSensor.java:91) [sonar-java-plugin-2.8.jar:na]
[22:04:37]: at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:122) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67) [sonar-batch-maven-compat-5.0.1.jar:na]
[22:04:37]: at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) [sonar-runner-batch7101932206275395209.jar:na]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
[22:04:37]: at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.delegateExecution(BatchLauncher.java:87) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.run(BatchLauncher.java:75) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_11]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.sonar.runner.api.Runner.execute(Runner.java:100) [sonar-runner-api-2.4.jar:na]
[22:04:37]: at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135) [sonar-maven-plugin-2.5.jar:na]
[22:04:37]: at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:138) [sonar-maven-plugin-2.5.jar:na]
[22:04:37]: at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) [maven-core-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) [maven-embedder-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) [maven-embedder-3.0.4.jar:3.0.4]
[22:04:37]: at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) [maven-embedder-3.0.4.jar:3.0.4]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_11]
[22:04:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_11]
[22:04:37]: at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_11]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) [plexus-classworlds-2.4.jar:na]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) [plexus-classworlds-2.4.jar:na]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) [plexus-classworlds-2.4.jar:na]
[22:04:37]: at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) [plexus-classworlds-2.4.jar:na]
您遇到了以下问题: http://jira.codehaus.org/browse/SONARJAVA-876
基本上,方法引用表达式的类型没有解析也没有设置。因此,您会遇到此非法状态异常,因为表达式应始终具有类型。
从您的日志可以看出,您使用的是sonar-java插件版本2.8,请将您的插件更新到最新版本以解决您的问题。
我也遇到过类似的问题。这是因为 java 版本不兼容,正如@Ahmed Ashour 在之前的回答中所说。在我们的 SonarQube 门户中,在 Administration => Marketplace => 下更新 SonarJava 插件 => 搜索 SonarJava 并将其更新到最新版本。然后重启SonarQube。
Screenshot for your reference
在 Eclipse 中右键单击项目-->属性-->Java构建路径-->库选项卡-->JRE 系统库并单击编辑按钮。
单击备用 JRE-->已安装的 JRE--->搜索
导航到 Java 安装的文件夹和 select [C:\Program Files\Java\jdk1.8.0_281]
点击应用并运行你的项目