quarkiverse / quarkus-dapr

The Distributed Application Runtime (Dapr) provides APIs that simplify microservice connectivity
https://dapr.io/
Apache License 2.0
31 stars 16 forks source link

Failed to start quarkus #138

Closed mcruzdev closed 1 month ago

mcruzdev commented 10 months ago

Using the Quarkus version 3.6.5 when is added the Quarkus Dapr extension with the version 2.0.0 I am getting the following StackTrace:

java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:101)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:113)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoSuchFieldError: Companion
        at io.dapr.client.DaprHttp.<clinit>(DaprHttp.java:131)
        at io.dapr.client.DaprHttpBuilder.buildDaprHttp(DaprHttpBuilder.java:93)
        at io.dapr.client.DaprHttpBuilder.build(DaprHttpBuilder.java:55)
        at io.dapr.client.DaprClientBuilder.buildDaprClientHttp(DaprClientBuilder.java:196)
        at io.dapr.client.DaprClientBuilder.buildDaprClient(DaprClientBuilder.java:167)
        at io.dapr.client.DaprClientBuilder.build(DaprClientBuilder.java:137)
        at io.quarkiverse.dapr.runtime.DaprProducer.daprClient(DaprProducer.java:47)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_daprClient_DUA8HkilYyiFoTtxRarvs-STDwo_Bean.doCreate(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_daprClient_DUA8HkilYyiFoTtxRarvs-STDwo_Bean.create(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_daprClient_DUA8HkilYyiFoTtxRarvs-STDwo_Bean.create(Unknown Source)
        at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:119)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:38)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
        at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32)
        at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
        at io.quarkus.arc.impl.ComputingCacheContextInstances.computeIfAbsent(ComputingCacheContextInstances.java:19)
        at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:35)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_daprClient_DUA8HkilYyiFoTtxRarvs-STDwo_Bean.get(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_daprClient_DUA8HkilYyiFoTtxRarvs-STDwo_Bean.get(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_syncDaprClient_4MN102pn3-rKDeVqYtGFbzkYjCY_Bean.doCreate(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_syncDaprClient_4MN102pn3-rKDeVqYtGFbzkYjCY_Bean.create(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_syncDaprClient_4MN102pn3-rKDeVqYtGFbzkYjCY_Bean.create(Unknown Source)
        at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:119)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:38)
        at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
        at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32)
        at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
        at io.quarkus.arc.impl.ComputingCacheContextInstances.computeIfAbsent(ComputingCacheContextInstances.java:19)
        at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:35)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_syncDaprClient_4MN102pn3-rKDeVqYtGFbzkYjCY_Bean.get(Unknown Source)
        at io.quarkiverse.dapr.runtime.DaprProducer_ProducerMethod_syncDaprClient_4MN102pn3-rKDeVqYtGFbzkYjCY_Bean.get(Unknown Source)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:553)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:533)
        at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:566)
        at io.quarkus.arc.impl.ArcContainerImpl.instance(ArcContainerImpl.java:338)
        at io.quarkiverse.dapr.runtime.DaprProducer_Observer_Synthetic_K5V31Em4thCJd4g0YAOtfMD2Yi8.notify(Unknown Source)
        at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:346)
        at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:328)
        at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:82)
        at io.quarkus.arc.runtime.ArcRecorder.fireLifecycleEvent(ArcRecorder.java:157)
        at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:108)
        at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy_0(Unknown Source)
        at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent1144526294.deploy(Unknown Source)
        ... 13 more

Caused by: java.lang.NoSuchFieldError: Companion

It is necessary to add the following dependency to solve the issue.

    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>4.10.0</version>
    </dependency>

Is it the expected behavior?

zhfeng commented 10 months ago

I think so. Take a look at

@skyao can you check it from dapr side? I only find https://github.com/dapr/java-sdk/blob/master/sdk/pom.xml#L58-L62