Unsupported class file major version 25888
adamzovits opened this issue · 2 comments
Issue Description
Running a Sonar analysis (sonar.analysis.mode=preview) results in over a hundred exceptions, each exactly like the one pasted below.
Sonar then proceeds to find an unrealistically large number of issues compared to the size of the changeset the build was running on.
Based on the "Caused by" exception, whose message can only be found in https://issuehunt.io/r/spotbugs/sonar-findbugs/issues/307 we deactivated Lombok, which failed to cause any kind of change in the observed behaviour. The behaviour is fully reproducible with the complete project.
Both classes mentioned (before and after) indicate "major version: 55" when inspected via "javap -verbose", so it might be that the 25888 major version exception is thrown when processing a third one - but which class?
Environment
Component | Version |
---|---|
SonarQube | 7.6.0.21501 |
Sonar-FindBugs | 3.10.0 |
Maven | 3.5.3 |
Gradle | --- |
Java | jdk-12.0.1 |
Code (If needed)
I can't include the actual project files and a minimal reproducible example has not yet been created - is the issue with Sonar-Findbugs at all?
15:07:07 WARN: The class 'com.mycompany.and.package.names.redacted.ClassName' could not be matched to its original source file. It might be a dynamically generated class.
15:07:07 WARN: Failed to load the class file metadata
15:07:07 org.sonar.plugins.findbugs.resource.ClassMetadataLoadingException: ASM failed to load classfile metadata
15:07:07 at org.sonar.plugins.findbugs.resource.DebugExtensionExtractor.getDebugExtFromClass(DebugExtensionExtractor.java:49)
15:07:07 at org.sonar.plugins.findbugs.resource.ByteCodeResourceLocator.extractSmapLocation(ByteCodeResourceLocator.java:168)
15:07:07 at org.sonar.plugins.findbugs.FindbugsSensor.execute(FindbugsSensor.java:166)
15:07:07 at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
15:07:07 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
15:07:07 at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
15:07:07 at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
15:07:07 at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
15:07:07 at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
15:07:07 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
15:07:07 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
15:07:07 at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:408)
15:07:07 at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:403)
15:07:07 at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:360)
15:07:07 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
15:07:07 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
15:07:07 at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
15:07:07 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
15:07:07 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
15:07:07 at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
15:07:07 at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
15:07:07 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
15:07:07 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:07:07 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
15:07:07 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
15:07:07 at java.lang.reflect.Method.invoke(Unknown Source)
15:07:07 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
15:07:07 at com.sun.proxy.$Proxy0.execute(Unknown Source)
15:07:07 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:185)
15:07:07 at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:137)
15:07:07 at org.sonarsource.scanner.cli.Main.execute(Main.java:111)
15:07:07 at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
15:07:07 at org.sonarsource.scanner.cli.Main.main(Main.java:61)
15:07:07 Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 25888
15:07:07 at org.objectweb.asm.ClassReader.<init>(ClassReader.java:184)
15:07:07 at org.objectweb.asm.ClassReader.<init>(ClassReader.java:166)
15:07:07 at org.objectweb.asm.ClassReader.<init>(ClassReader.java:152)
15:07:07 at org.objectweb.asm.ClassReader.<init>(ClassReader.java:273)
15:07:07 at org.sonar.plugins.findbugs.resource.DebugExtensionExtractor.getDebugExtFromClass(DebugExtensionExtractor.java:43)
15:07:07 ... 32 common frames omitted
15:07:07
15:07:07 WARN: The class 'com.mycompany.and.package.names.redacted.AnotherClassName' could not be matched to its original source file. It might be a dynamically generated class.
Was it working previously? If so, what was the change?
I quickly looked into it and it seems like there was a change for the ASM version: 7bb76c4 back in 2019
This was released in version 3.11.0 of the plugin, so you might have better luck with: from what I can see ASM 5 did not support Java 12: https://asm.ow2.io/versions.html
But really SonarQube 7.6 has been EOL for a while now and the corresponding findbugs plugin is ancient too. If you can it would be good to upgrade to at least SonarQube 8.9 which is the current LTS
Thanks for the advice, we'll look into upgrading the service.
The setup has been working without any problems for more than a year, in fact this issue affects only one PR - all others can be built and scanned without this problem. We'll see if we can isolate the change causing this issue. Thanks for the assistance!