eventuate-local / eventuate-local-quarkus

Other
4 stars 7 forks source link

eventuate-client-java-quarkus-jdbc tests fail because of AmbiguousResolutionException #2

Open dartartem opened 3 years ago

dartartem commented 3 years ago
java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
    at io.quarkus.test.junit.QuarkusTestExtension.throwBootFailureException(QuarkusTestExtension.java:564)
    at io.quarkus.test.junit.QuarkusTestExtension.interceptTestClassConstructor(QuarkusTestExtension.java:633)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.api.extension.InvocationInterceptor.interceptTestClassConstructor(InvocationInterceptor.java:72)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:77)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestClassConstructor(ClassBasedTestDescriptor.java:342)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:289)
    at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:79)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:267)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:259)
    at java.util.Optional.orElseGet(Optional.java:267)
    at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:258)
    at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:101)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:100)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:65)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:111)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:111)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:79)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
    at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    at com.sun.proxy.$Proxy2.stop(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Failed to start quarkus
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:478)
    at io.quarkus.runtime.Application.start(Application.java:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:212)
    at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:254)
    at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:542)
    at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:577)
    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)
    ... 56 more
Caused by: java.lang.RuntimeException: Error injecting io.eventuate.javaclient.eventdispatcher.EventDispatcherInitializer io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar.eventDispatcherInitializer
    at io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar_Bean.create(EventHandlerRegistrar_Bean.zig:273)
    at io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar_Bean.create(EventHandlerRegistrar_Bean.zig:342)
    at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
    at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
    at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
    at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
    at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
    at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
    at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
    at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:17)
    at io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar_ClientProxy.arc$delegate(EventHandlerRegistrar_ClientProxy.zig:85)
    at io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar_ClientProxy.arc_contextualInstance(EventHandlerRegistrar_ClientProxy.zig:100)
    at io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar_Observer_Synthetic_d70cd75bf32ab6598217b9a64a8473d65e248c05.notify(EventHandlerRegistrar_Observer_Synthetic_d70cd75bf32ab6598217b9a64a8473d65e248c05.zig:102)
    at io.quarkus.arc.impl.EventImpl$Notifier.notifyObservers(EventImpl.java:282)
    at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:267)
    at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:69)
    at io.quarkus.arc.runtime.LifecycleEventRunner.fireStartupEvent(LifecycleEventRunner.java:23)
    at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:60)
    at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent-858218658.deploy_0(LifecycleEventsBuildStep$startupEvent-858218658.zig:81)
    at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent-858218658.deploy(LifecycleEventsBuildStep$startupEvent-858218658.zig:40)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:412)
    ... 71 more
Caused by: javax.enterprise.inject.AmbiguousResolutionException: Beans: [io.eventuate.javaclient.quarkus.common.crud.EventuateCommonCrudConfiguration_ProducerMethod_eventuateAggregateStoreCrud_069ef68817bc636a27957bb89fb0ceaf7f62436e_Bean@30027765, io.eventuate.javaclient.quarkus.common.EventuateCommonConfiguration_ProducerMethod_aggregateEventStore_5ef61aa936f9e3ea490c6dfe593dfcc61ba80722_Bean@598e4690]
    at io.quarkus.arc.impl.InstanceImpl.bean(InstanceImpl.java:178)
    at io.quarkus.arc.impl.InstanceImpl.getInternal(InstanceImpl.java:196)
    at io.quarkus.arc.impl.InstanceImpl.get(InstanceImpl.java:93)
    at io.eventuate.javaclient.quarkus.crud.EventuateJavaClientDomainCrudConfiguration.eventHandlerProcessorEventHandlerContextReturningVoid(EventuateJavaClientDomainCrudConfiguration.java:16)
    at io.eventuate.javaclient.quarkus.crud.EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.create(EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.zig:238)
    at io.eventuate.javaclient.quarkus.crud.EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.create(EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.zig:253)
    at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
    at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
    at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
    at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
    at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
    at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
    at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
    at io.eventuate.javaclient.quarkus.crud.EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.get(EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.zig:285)
    at io.eventuate.javaclient.quarkus.crud.EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.get(EventuateJavaClientDomainCrudConfiguration_ProducerMethod_eventHandlerProcessorEventHandlerContextReturningVoid_7eee3423502bf8b05afe5cc4f043ca1887726969_Bean.zig:301)
    at io.quarkus.arc.impl.InstanceImpl.getBeanInstance(InstanceImpl.java:210)
    at io.quarkus.arc.impl.InstanceImpl.access$200(InstanceImpl.java:32)
    at io.quarkus.arc.impl.InstanceImpl$InstanceIterator.next(InstanceImpl.java:246)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at io.eventuate.javaclient.quarkus.events.EventuateJavaClientDomainEventsConfiguration.eventDispatcherInitializer(EventuateJavaClientDomainEventsConfiguration.java:18)
    at io.eventuate.javaclient.quarkus.events.EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.create(EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.zig:392)
    at io.eventuate.javaclient.quarkus.events.EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.create(EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.zig:407)
    at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
    at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
    at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
    at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
    at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
    at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
    at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
    at io.eventuate.javaclient.quarkus.events.EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.get(EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.zig:439)
    at io.eventuate.javaclient.quarkus.events.EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.get(EventuateJavaClientDomainEventsConfiguration_ProducerMethod_eventDispatcherInitializer_2bc7c7d95de54289d20d4faa1a4a2042c5b53101_Bean.zig:455)
    at io.eventuate.javaclient.quarkus.events.EventHandlerRegistrar_Bean.create(EventHandlerRegistrar_Bean.zig:256)
    ... 91 more

Cannont inject EventDispatcherInitializer (https://github.com/dartartem/eventuate-local-quarkus/blob/master/eventuate-client-java-quarkus-events/src/main/java/io/eventuate/javaclient/quarkus/events/EventuateJavaClientDomainEventsConfiguration.java#L17) into EventHandlerRegistrar (https://github.com/dartartem/eventuate-local-quarkus/blob/master/eventuate-client-java-quarkus-events/src/main/java/io/eventuate/javaclient/quarkus/events/EventHandlerRegistrar.java) Because AmbiguousResolutionException

EventuateCommonCrudConfiguration defines EventuateAggregateStoreCrud (interface without super interfaces) https://github.com/dartartem/eventuate-local-quarkus/blob/master/eventuate-client-java-quarkus-common-crud/src/main/java/io/eventuate/javaclient/quarkus/common/crud/EventuateCommonCrudConfiguration.java#L30

EventuateCommonConfiguration defines EventuateAggregateStore (extends EventuateAggregateStoreCrud, EventuateAggregateStoreEvents) https://github.com/dartartem/eventuate-local-quarkus/blob/master/eventuate-client-java-quarkus-common/src/main/java/io/eventuate/javaclient/quarkus/common/EventuateCommonConfiguration.java#L13

It is not clear why error is related to EventuateAggregateStoreCrud and EventuateAggregateStore, since EventDispatcherInitializer takes EventuateAggregateStoreEvents (https://github.com/dartartem/eventuate-local-quarkus/blob/master/eventuate-client-java-quarkus-common-events/src/main/java/io/eventuate/javaclient/quarkus/common/events/EventuateCommonEventsQuarkus.java#L16) as parameter.

But, it seems it is related to https://quarkus.io/guides/cdi

Point 6: There is a simple rule: exactly one bean must be assignable to an injection point, otherwise the build fails.

For example we have following configuration:

@Singleton
public A a() {
    return new A() {};
}

@Singleton
public B b() {
    return new B() {};
}

@Singleton
public AB ab() {
    return new AB() {};
}

@Singleton
public Some some(B b) {
    return new Some(b);
}

A, B - just interfaces AB - interface that inherits A and B Some - just a class that takes B as parameter.

In case of Spring it works. It would inject B, but if remove it's definition, spring will Use AB bean. In case of Micronaut it also works, It would inject B. It strictly requires B return type. If remove B definition, it will fail.

But in case of quarkus we get an error: javax.enterprise.inject.AmbiguousResolutionException

Because it does not care about configuration method return type, it only care about bean itself.

And both of them bean B and bean AB inherited from interface B.

dartartem commented 3 years ago

Fixed by using @Named annotation on EventuateAggregateStoreCrud and EventuateAggregateStoreEvents to avoid ambiguity with EventuateAggregateStore