gpt4 book ai didi

java - Sonar 失败 :[ERROR] Unable to create symbol table for

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:57:53 26 4
gpt4 key购买 nike

当我使用 SonarQube 5.6.5 运行分析时,我在 java 源代码上收到以下异常。

我正在使用 Maven 项目运行此分析:mvn sonar:sonar
几乎每个 jar 都失败了,但它通过了 superpom。我没有写任何源代码,我只是包括 sonarqube 插件。此错误是由于源代码还是 Sonar 插件引起的?

Unable to create symbol table for : /Users/dagrawa/EInkReader/apps/ramp/src/com/amazon/ebook/ramp/utils/RAMPUtils.java
java.lang.IllegalArgumentException: null
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:185) ~[sonar-java-plugin-4.15.0.12310.jar:na]
at org.objectweb.asm.ClassReader.<init>(ClassReader.java:168) ~[sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.resolve.BytecodeCompleter.loadClass(BytecodeCompleter.java:228) ~[sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.resolve.Symbols.<init>(Symbols.java:176) ~[sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.resolve.SemanticModel.createFor(SemanticModel.java:58) ~[sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.model.VisitorsBridge.visitFile(VisitorsBridge.java:101) ~[sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.ast.JavaAstScanner.simpleScan(JavaAstScanner.java:96) [sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.ast.JavaAstScanner.scan(JavaAstScanner.java:68) [sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.JavaSquid.scanSources(JavaSquid.java:119) [sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.java.JavaSquid.scan(JavaSquid.java:113) [sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.plugins.java.JavaSquidSensor.execute(JavaSquidSensor.java:84) [sonar-java-plugin-4.15.0.12310.jar:na]
at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79) [sonar-scanner-engine-shaded-5.6.5.jar:na]
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) [sonar-scanner-api-batch4958703376323836077.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:564) ~[na:na]
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) [sonar-scanner-api-2.10.0.1189.jar:na]
at com.sun.proxy.$Proxy23.execute(Unknown Source) [na:na]
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:171) [sonar-scanner-api-2.10.0.1189.jar:na]
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:128) [sonar-scanner-api-2.10.0.1189.jar:na]
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:63) [sonar-maven-plugin-3.4.0.905.jar:na]
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:108) [sonar-maven-plugin-3.4.0.905.jar:na]
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) [maven-core-3.5.3.jar:3.5.3]
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956) [maven-embedder-3.5.3.jar:3.5.3]
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290) [maven-embedder-3.5.3.jar:3.5.3]
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194) [maven-embedder-3.5.3.jar:3.5.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:564) ~[na:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) [plexus-classworlds-2.5.2.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) [plexus-classworlds-2.5.2.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) [plexus-classworlds-2.5.2.jar:na]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) [plexus-classworlds-2.5.2.jar:na]

最佳答案

我也遇到过类似的问题。这是因为@Ahmed Ashour 在之前的回答中所说的 java 版本不兼容。在 SonarQube 我们门户中,更新 Administration => Marketplace => 下的 SonarJava 插件搜索 SonarJava 并将其更新到最新版本。然后重启 SonarQube。

Screenshot for your reference

关于java - Sonar 失败 :[ERROR] Unable to create symbol table for <Class>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50346358/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com