Quarkus: SmallRyeMetricsProcessor Unsupported api 524288

Created on 5 Jun 2020  Â·  20Comments  Â·  Source: quarkusio/quarkus

how to reproduce

git clone https://github.com/xmlking/micro-apps.git
gradle :apps:greeting-service:quarkusBuild -x test

Error

    [error]: Build step io.quarkus.smallrye.metrics.deployment.SmallRyeMetricsProcessor#registerBaseAndVendorMetrics threw an exception: java.lang.IllegalArgumentException: Unsupported api 524288
        at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:74)
        at io.quarkus.gizmo.GizmoClassVisitor.<init>(GizmoClassVisitor.java:22)
        at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:150)
        at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:203)
        at io.quarkus.deployment.proxy.ProxyFactory.doDefineClass(ProxyFactory.java:189)
        at io.quarkus.deployment.proxy.ProxyFactory.defineClass(ProxyFactory.java:120)
        at io.quarkus.deployment.proxy.ProxyFactory.newInstance(ProxyFactory.java:204)
        at io.quarkus.deployment.recording.BytecodeRecorderImpl.getRecordingProxy(BytecodeRecorderImpl.java:286)
        at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFrom$85(ExtensionLoader.java:759)
        at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:928)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
        at java.base/java.lang.Thread.run(Thread.java:834)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)

kinbug

Most helpful comment

I have the problem with Quarkus 1.6.0.Final using @QuarkusTest when launching the tests from Intellij.

java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.smallrye.health.deployment.SmallRyeHealthProcessor#build threw an exception: java.lang.IllegalArgumentException: Unsupported api 524288
at org.objectweb.asm.ClassVisitor.(ClassVisitor.java:70)
at io.quarkus.gizmo.GizmoClassVisitor.(GizmoClassVisitor.java:22)
at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:150)
at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:203)
at io.quarkus.deployment.proxy.ProxyFactory.doDefineClass(ProxyFactory.java:189)
at io.quarkus.deployment.proxy.ProxyFactory.defineClass(ProxyFactory.java:120)
at io.quarkus.deployment.proxy.ProxyFactory.newInstance(ProxyFactory.java:204)
at io.quarkus.deployment.recording.BytecodeRecorderImpl.getRecordingProxy(BytecodeRecorderImpl.java:286)
at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFrom$85(ExtensionLoader.java:759)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:928)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)

[error]: Build step io.quarkus.vertx.http.deployment.HttpSecurityProcessor#initBasicAuth threw an exception: java.lang.IllegalArgumentException: Unsupported api 524288

All 20 comments

The problem seems to be that your build, for some reason, pulls in ASM 7.3.1 to the build classpath, whereas Quarkus depends on ASM 8.0.1 for building (api 524288 means ASM 8). One of your dependencies probably pulls that in and overrides the version that should be used, I suspect it must be something with io.grpc:grpc-kotlin-stub. I'm very unfamiliar with Gradle or gRPC though, so I'm mostly guessing.

It's not specific to SmallRyeMetricsProcessor, if I remove metrics from the project, I get the same exception, just from different processors.

Perhaps @cescoffier or @michalszynkiewicz might have an idea

gradle -q :apps:greeting-service:dependencyInsight  --dependency org.ow2.asm:asm --configuration testCompileClasspath
Version: 1.6.5-SNAPSHOT,  Branch: develop, isCI: false
SpotlessChangelog Version Next: 1.7.0-SNAPSHOT  Last: 1.6.4
org.ow2.asm:asm:8.0.1
   variant "compile" [
      org.gradle.status                  = release (not requested)
      org.gradle.usage                   = java-api
      org.gradle.libraryelements         = jar (compatible with: classes)
      org.gradle.category                = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling     = external
         org.jetbrains.kotlin.platform.type = jvm
         org.gradle.jvm.version             = 11
   ]
   Selection reasons:
      - By constraint
      - Forced

org.ow2.asm:asm:8.0.1
+--- io.quarkus:quarkus-core-deployment:1.5.0.Final
|    +--- io.quarkus:quarkus-test-common:1.5.0.Final
|    |    \--- io.quarkus:quarkus-junit5:1.5.0.Final
|    |         +--- testCompileClasspath (requested io.quarkus:quarkus-junit5)
|    |         \--- io.quarkus:quarkus-universe-bom:1.5.0.Final
|    |              \--- testCompileClasspath
|    \--- io.quarkus:quarkus-jsonp-deployment:1.5.0.Final
|         \--- io.quarkus:quarkus-test-common:1.5.0.Final (*)
+--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
+--- io.quarkus.gizmo:gizmo:1.0.3.Final
|    +--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
|    \--- io.quarkus:quarkus-core-deployment:1.5.0.Final (*)
+--- org.ow2.asm:asm-tree:8.0.1
|    +--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
|    +--- org.ow2.asm:asm-util:8.0.1
|    |    \--- io.quarkus.gizmo:gizmo:1.0.3.Final (*)
|    \--- org.ow2.asm:asm-analysis:8.0.1
|         +--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
|         \--- org.ow2.asm:asm-util:8.0.1 (*)
\--- org.ow2.asm:asm-util:8.0.1 (*)

org.ow2.asm:asm:7.3.1 -> 8.0.1
\--- io.quarkus:quarkus-bootstrap-core:1.5.0.Final
     +--- io.quarkus:quarkus-junit5:1.5.0.Final
     |    +--- testCompileClasspath (requested io.quarkus:quarkus-junit5)
     |    \--- io.quarkus:quarkus-universe-bom:1.5.0.Final
     |         \--- testCompileClasspath
     \--- io.quarkus:quarkus-core-deployment:1.5.0.Final
          +--- io.quarkus:quarkus-test-common:1.5.0.Final
          |    \--- io.quarkus:quarkus-junit5:1.5.0.Final (*)
          \--- io.quarkus:quarkus-jsonp-deployment:1.5.0.Final
               \--- io.quarkus:quarkus-test-common:1.5.0.Final (*)

org.ow2.asm:asm-analysis:8.0.1
   variant "compile" [
      org.gradle.status                  = release (not requested)
      org.gradle.usage                   = java-api
      org.gradle.libraryelements         = jar (compatible with: classes)
      org.gradle.category                = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling     = external
         org.jetbrains.kotlin.platform.type = jvm
         org.gradle.jvm.version             = 11
   ]
   Selection reasons:
      - By constraint
      - Forced

org.ow2.asm:asm-analysis:8.0.1
+--- io.quarkus:quarkus-universe-bom:1.5.0.Final
|    \--- testCompileClasspath
\--- org.ow2.asm:asm-util:8.0.1
     \--- io.quarkus.gizmo:gizmo:1.0.3.Final
          +--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
          \--- io.quarkus:quarkus-core-deployment:1.5.0.Final
               +--- io.quarkus:quarkus-test-common:1.5.0.Final
               |    \--- io.quarkus:quarkus-junit5:1.5.0.Final
               |         +--- testCompileClasspath (requested io.quarkus:quarkus-junit5)
               |         \--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
               \--- io.quarkus:quarkus-jsonp-deployment:1.5.0.Final
                    \--- io.quarkus:quarkus-test-common:1.5.0.Final (*)

org.ow2.asm:asm-tree:8.0.1
   variant "compile" [
      org.gradle.status                  = release (not requested)
      org.gradle.usage                   = java-api
      org.gradle.libraryelements         = jar (compatible with: classes)
      org.gradle.category                = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling     = external
         org.jetbrains.kotlin.platform.type = jvm
         org.gradle.jvm.version             = 11
   ]
   Selection reasons:
      - By constraint
      - Forced

org.ow2.asm:asm-tree:8.0.1
+--- io.quarkus:quarkus-universe-bom:1.5.0.Final
|    \--- testCompileClasspath
+--- org.ow2.asm:asm-analysis:8.0.1
|    +--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
|    \--- org.ow2.asm:asm-util:8.0.1
|         \--- io.quarkus.gizmo:gizmo:1.0.3.Final
|              +--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
|              \--- io.quarkus:quarkus-core-deployment:1.5.0.Final
|                   +--- io.quarkus:quarkus-test-common:1.5.0.Final
|                   |    \--- io.quarkus:quarkus-junit5:1.5.0.Final
|                   |         +--- testCompileClasspath (requested io.quarkus:quarkus-junit5)
|                   |         \--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
|                   \--- io.quarkus:quarkus-jsonp-deployment:1.5.0.Final
|                        \--- io.quarkus:quarkus-test-common:1.5.0.Final (*)
\--- org.ow2.asm:asm-util:8.0.1 (*)

org.ow2.asm:asm-util:8.0.1
   variant "compile" [
      org.gradle.status                  = release (not requested)
      org.gradle.usage                   = java-api
      org.gradle.libraryelements         = jar (compatible with: classes)
      org.gradle.category                = library

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling     = external
         org.jetbrains.kotlin.platform.type = jvm
         org.gradle.jvm.version             = 11
   ]

org.ow2.asm:asm-util:8.0.1
\--- io.quarkus.gizmo:gizmo:1.0.3.Final
     +--- io.quarkus:quarkus-universe-bom:1.5.0.Final
     |    \--- testCompileClasspath
     \--- io.quarkus:quarkus-core-deployment:1.5.0.Final
          +--- io.quarkus:quarkus-test-common:1.5.0.Final
          |    \--- io.quarkus:quarkus-junit5:1.5.0.Final
          |         +--- testCompileClasspath (requested io.quarkus:quarkus-junit5)
          |         \--- io.quarkus:quarkus-universe-bom:1.5.0.Final (*)
          \--- io.quarkus:quarkus-jsonp-deployment:1.5.0.Final
               \--- io.quarkus:quarkus-test-common:1.5.0.Final (*)

(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

I even tried to lock to version 7.3.1, but still the same error...

configurations.all {
    resolutionStrategy.eachDependency {
        if (requested.group == "org.ow2.asm") {
            useVersion("7.3.1")
            because("fix grpc version to latest")
        }
    }
}

There is a discrepancy in ASM dependencies, the Bootstrap project indeed depends on 7.3.1 (https://github.com/quarkusio/quarkus/blob/edd539f29c305ab908ed6bcd315821e1e5beb137/independent-projects/bootstrap/pom.xml#L44) while the runtime bom is already at 8.0.1 (https://github.com/quarkusio/quarkus/blob/edd539f29c305ab908ed6bcd315821e1e5beb137/bom/runtime/pom.xml#L68)

However, I tried updating the Bootstrap dependency to 8.0.1 and I'm weirdly still seeing the exception even though ASM 7.3.1 does not appear in gradle dependencies output anymore at all. The exception suggests that ASM 7.3.1 is still there somewhere, because the line ClassVisitor.java:74 corresponds to the exception there, and it does not correspond to that exception in 8.0.1.

I see the same discrepancy and error when using maven. I don't think it's related to metrics (not using them). It also seems to be present in 1.6.0.Final:

...
[INFO] +- io.quarkus:quarkus-junit5:jar:1.6.0.Final:test
[INFO] |  +- io.quarkus:quarkus-bootstrap-core:jar:1.6.0.Final:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-app-model:jar:1.6.0.Final:test
[INFO] |  |  \- io.quarkus:quarkus-bootstrap-maven-resolver:jar:1.6.0.Final:test
[INFO] |  |     +- org.ow2.asm:asm:jar:7.3.1:test
...
[INFO] |  +- io.quarkus:quarkus-test-common:jar:1.6.0.Final:test
[INFO] |  |  +- io.quarkus:quarkus-core-deployment:jar:1.6.0.Final:test
[INFO] |  |  |  +- io.quarkus.gizmo:gizmo:jar:1.0.3.Final:test
[INFO] |  |  |  |  \- org.ow2.asm:asm-util:jar:8.0.1:test
[INFO] |  |  |  |     +- org.ow2.asm:asm-tree:jar:8.0.1:test
[INFO] |  |  |  |     \- org.ow2.asm:asm-analysis:jar:8.0.1:test

For me:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>8.0.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

Works around the issue.

The versions cannot be the whole story though as this workaround is not needed in 1.5.0.Final even though it shows the same version mismatches.

I have the problem with Quarkus 1.6.0.Final using @QuarkusTest when launching the tests from Intellij.

java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.smallrye.health.deployment.SmallRyeHealthProcessor#build threw an exception: java.lang.IllegalArgumentException: Unsupported api 524288
at org.objectweb.asm.ClassVisitor.(ClassVisitor.java:70)
at io.quarkus.gizmo.GizmoClassVisitor.(GizmoClassVisitor.java:22)
at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:150)
at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:203)
at io.quarkus.deployment.proxy.ProxyFactory.doDefineClass(ProxyFactory.java:189)
at io.quarkus.deployment.proxy.ProxyFactory.defineClass(ProxyFactory.java:120)
at io.quarkus.deployment.proxy.ProxyFactory.newInstance(ProxyFactory.java:204)
at io.quarkus.deployment.recording.BytecodeRecorderImpl.getRecordingProxy(BytecodeRecorderImpl.java:286)
at io.quarkus.deployment.ExtensionLoader.lambda$loadStepsFrom$85(ExtensionLoader.java:759)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:928)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)

[error]: Build step io.quarkus.vertx.http.deployment.HttpSecurityProcessor#initBasicAuth threw an exception: java.lang.IllegalArgumentException: Unsupported api 524288

@xmlking does this still happen in 1.6.1.Final?

@geoand for me it's still present in 1.6.1.Final

java.lang.RuntimeException:
java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.deployment.steps.BootstrapConfigSetupBuildStep#setupBootstrapConfig threw an exception: java.lang.IllegalArgumentException: Unsupported api 524288
at org.objectweb.asm.ClassVisitor.(ClassVisitor.java:70)
at io.quarkus.gizmo.GizmoClassVisitor.(GizmoClassVisitor.java:22)
at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:150)
at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:203)
at io.quarkus.deployment.steps.BootstrapConfigSetupBuildStep.setupBootstrapConfig(BootstrapConfigSetupBuildStep.java:40)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
at java.base/java.lang.Thread.run(Thread.java:834)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)

No more error if I remove this dep from my module pom :

<dependency>
      <groupId>org.graalvm.nativeimage</groupId>
      <artifactId>svm</artifactId>
 </dependency>

Yes, so the issue here is that the svm dependency is including a non-shaded version of ASM which conflicts with our own.

Apparently, they have solved this issue in later versions but right now, that's a big problem :/

FWIW, I still have this problem with Quarkus 1.7.0.Final when launching a test from IntelliJ.

FWIW, I still have this problem with Quarkus 1.7.0.Final when launching a test from IntelliJ.

Hmm... Now that I try to reproduce it again, I couldn't do it... Possibly IntelliJ cached some stale data somewhere...

Yeah, hopefully, the next GraalVM update will fix it.

For now, if not using GraalVM, you can exclude the org.graalvm.nativeimage:svm dependency.

I'm seeing this with 1.7.0.Final as well as 1.6.1.Final. I don't experience it when running tests from bash with mvn test, only with IntelliJ. I've tried deleting the .idea folder as I had seen in this stackoverflow answer (https://stackoverflow.com/a/63247936), but to no avail. The maven dependency tree only shows version 8.0.1 of asm.

If it helps, I've experienced this in both IntelliJ 2019.3 and 2020.2 (although the project was cloned and originally worked-on with 2019).

Hello @oran0007 I can confirm your findings. Weird thing is, I have managed to run the unit tests once (when the workspace is brand new to IntelliJ say) and then something happens that it messes it up. Productivity killer.

Same code base and everything else. It happens on Windows but not on the Mac. Can someone confirm?

I suspect in my case the problem was caused by the Quarkus IntelliJ plugin. Don't as me which version or even which one of the two plugins, I don't know. I suspect it somewhen pulled in an old version of Quarkus jars and then IntelliJ for some reason tried to launch my application with those. That's my theory anyway.

I remove the quarkus plugin from Intellij. Was causing too mush troubles

Le mar. 25 août 2020 16 h 56, Knut Wannheden notifications@github.com a
écrit :

I suspect in my case the problem was caused by the Quarkus IntelliJ
plugin. Don't as me which version or even which one of the two plugins, I
don't know. I suspect it somewhen pulled in an old version of Quarkus jars
and then IntelliJ for some reason tried to launch my application with
those. That's my theory anyway.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/quarkusio/quarkus/issues/9832#issuecomment-680265583,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AABO3B65XESIVOTPFGE3RXLSCQQQBANCNFSM4NUNYQUA
.

I had the same problem in IntelliJ but removing the various Quarkus plugins didn´t help.
Only after I removed the library org.graalvm.nativeimage:svm from my local MVN repository, the tests were working again in IntelliJ.

Is this fixed, then? (dep issue?)

Was this page helpful?
0 / 5 - 0 ratings