web-dev-qa-db-fra.com

Le sondeur échoue: [ERREUR] Impossible de créer la table des symboles pour <Classe>

Lorsque j'exécute une analyse avec SonarQube 5.6.5, je reçois l'exception suivante sur Java source.

J'exécute cette analyse avec le projet maven: mvn sonar:sonar
Et ça échoue pour presque tous les pots mais ça passe pour superpom. Je n'ai écrit aucun code source, j'inclus juste le plugin sonarqube. Cette erreur est-elle due au code source ou au plug-in 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]
9
Divyanshu

J'ai également rencontré un problème similaire. Ceci est dû à l'incompatibilité de la version Java comme l'a dit @Ahmed Ashour dans la réponse précédente. Dans SonarQube, nous portons, mettons à jour SonarJava plugin sous Administration => Marketplace => recherchez SonarJava et mettez-le à jour vers la dernière version, puis redémarrez le SonarQube.

Screenshot for your reference

7
LoRe

D'après le code ici , cela se produit lorsque vous avez Java non compatible avec la version requise du sonar).

La configuration actuelle du sondeur est Java 8.

Vous pouvez dire au compilateur maven quelque chose comme:

<build>
    <plugins>
        <plugin>
            <groupId>org.Apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>
5
Ahmed Ashour