Quarkus: Quarkus won't start if both the micrometer extension and the vertx-web extension are enabled

Created on 18 Sep 2020  路  5Comments  路  Source: quarkusio/quarkus

Describe the bug

Caused by: java.lang.ExceptionInInitializerError
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:416)
        at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:196)
        at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:234)
        at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:512)
        at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:545)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$8(ClassBasedTestDescriptor.java:368)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeBeforeAllCallbacks(ClassBasedTestDescriptor.java:368)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:192)
        at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.before(ClassBasedTestDescriptor.java:78)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:136)
        ... 34 more
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:200)
        ... 46 more
Caused by: java.lang.NoClassDefFoundError: io/quarkus/resteasy/common/runtime/ResteasyContextProvider
        at io.quarkus.deployment.steps.SmallRyeContextPropagationProcessor$buildStatic-850855720.deploy_0(SmallRyeContextPropagationProcessor$buildStatic-850855720.zig:79)
        at io.quarkus.deployment.steps.SmallRyeContextPropagationProcessor$buildStatic-850855720.deploy(SmallRyeContextPropagationProcessor$buildStatic-850855720.zig:40)
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:136)
        ... 46 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.resteasy.common.runtime.ResteasyContextProvider
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:406)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:363)

To Reproduce

Add the micrometer extension to the vertx-web integration-test.

kinbug triagbackport?

All 5 comments

Down the rabbit hole a bit farther:

Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:200)
        ... 46 more
Caused by: java.lang.NoClassDefFoundError: io/quarkus/resteasy/common/runtime/ResteasyInjectorFactoryRecorder
        at io.quarkus.deployment.steps.ResteasyCommonProcessor$setupResteasyInjection-1799175235.deploy_0(ResteasyCommonProcessor$setupResteasyInjection-1799175235.zig:97)
        at io.quarkus.deployment.steps.ResteasyCommonProcessor$setupResteasyInjection-1799175235.deploy(ResteasyCommonProcessor$setupResteasyInjection-1799175235.zig:40)
        at io.quarkus.runner.ApplicationImpl.<clinit>(ApplicationImpl.zig:169)
        ... 46 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.resteasy.common.runtime.ResteasyInjectorFactoryRecorder
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:406)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:363)
        ... 49 more

This is ultimately due to the use of io.quarkus.resteasy.common.spi.ResteasyJaxrsProviderBuildItem to register the container filter. To use that build item, I need this:

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-server-common-deployment</artifactId>
        </dependency>

And that makes services from resteasy visible to service factories, which then attempt to instantiate the things.. and it doesn't end.

And, I was wrong. ;)

For posterity, my mistake was using -deployment instead of this:

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-common-spi</artifactId>
        </dependency>

I was going to post exactly that :).

Please mark the PR with triage/backport?, we will want it in 1.8.2 if we do one.

I have a fix coming both to fix the dependency, and update the JMX integration test to run w/ just vertx-web to make sure the deps stay fixed

Was this page helpful?
0 / 5 - 0 ratings