Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsatisfied dependency for type javax.persistence.EntityManager in orders-and-customers module #1

Open
dartartem opened this issue Feb 10, 2021 · 6 comments

Comments

@dartartem
Copy link
Contributor

Everything is configured as in eventuate-tram-quarkus-examples-customers-and-orders.
However when I am trying to use EntityManager I am getting this:

java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
[1] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
[2] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
	at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1063)
	at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:245)
	at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
	at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:423)
	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.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
	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.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more

	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: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
[1] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
[2] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
	at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1063)
	at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:245)
	at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
	at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:423)
	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.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
	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.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more

	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:274)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:150)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:57)
	at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:240)
	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: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
[1] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
[2] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
	at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1063)
	at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:245)
	at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
	at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:423)
	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.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
	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.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more

	at io.quarkus.builder.Execution.run(Execution.java:116)
	at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:148)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:272)
	... 67 more
Caused by: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
[1] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
[2] Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
	at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1063)
	at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:245)
	at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
	at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:423)
	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.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:972)
	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.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl#entityManager
	- declared on CLASS bean [types=[io.eventuate.examples.tram.sagas.ordersandcustomers.orders.domain.OrderDao, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl, java.lang.Object], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.orders.domain.OrderDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)
		... 14 more
	Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManager and qualifiers [@Default]
	- java member: io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl#entityManager
	- declared on CLASS bean [types=[java.lang.Object, io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl, io.eventuate.examples.tram.sagas.ordersandcustomers.customers.domain.CustomerDao], qualifiers=[@Default, @Any], target=io.eventuate.examples.tram.sagas.ordersandcustomers.quarkus.customers.domain.CustomerDaoImpl]
		at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:484)
		at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:378)
		at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:237)

Found this: quarkusio/quarkus#11483

You are likely either missing the JPA extension or don't have any entities in your project.

I realized that entities are in eventutate-tram-sagas and not indexed by jandex.

Solved by copying orders-and-customers to eventuate-tram-sagas-quarkus

@cer
Copy link
Contributor

cer commented Feb 10, 2021

I realized that entities are in eventutate-tram-sagas and not indexed by jandex.

Solved by copying orders-and-customers to eventuate-tram-sagas-quarkus

Please provide more explanation including commit

@dartartem
Copy link
Contributor Author

Please provide more explanation including commit

Chris, as I wrote in the email, I need some time to prepare commit.
I need to review, clean up, configure circle ci.
I will do it tomorrow ASAP.

Explanation:
Quarkus shows UnsatisfiedResolutionException because there are no entities visible to quarkus.
To work with beans and entities they should be indexed by special plugin for quarkus: "org.kordamp.gradle.jandex"
Since orders-and-customers module (that defines jpa entities) is located in original sagas project, it does not use jandex plugin.
Jandex is quarkus only plugin, so, I don't think that it makes sense to use it in eventuate-tram-sagas, so I copied that module to eventuate-tram-sagas-quarkus project and applied jandex plugin there.

@cer
Copy link
Contributor

cer commented Feb 10, 2021

Jandex is quarkus only plugin, so, I don't think that it makes sense to use it in eventuate-tram-sagas, so I copied that module to eventuate-tram-sagas-quarkus project and applied jandex plugin there.

https://quarkus.io/guides/cdi-reference says:

If you can’t modify the dependency, you can still index it by adding quarkus.index-dependency entries to your application.properties:

@dartartem
Copy link
Contributor Author

Yes, jandex creates index automatically. Probably I can create index manually, but I am not sure that is better than adding jandex plugin to orders-and-customers in original sagas project.

To summarize, we have following options:

  • copy orders-and-customers from original sagas to quarkus sagas project.
  • use jandex plugin directly in original sagas project
  • try to create index manually

I would prefer the first option. If you prefer 3 option, please confirm.

@cer
Copy link
Contributor

cer commented Feb 10, 2021

If you can’t modify the dependency, you can still index it by adding quarkus.index-dependency entries to your application.properties:

My interpretation of this sentence is that eventuate-tram-sagas/orders-and-customers is a dependency of eventuate-tram-sagas-quarkus. You could therefore index eventuate-tram-sagas/orders-and-customers by adding the necessary entries to eventuate-tram-sagas-quarkus's application.properties.

@dartartem
Copy link
Contributor Author

I indexed orders-and-customers by adding this:


quarkus.index-dependency.orders-and-customers.group-id=io.eventuate.tram.sagas
quarkus.index-dependency.orders-and-customers.artifact-id=orders-and-customers

to application.properties.

But there is one thing.

We have following dependency chain:

orders-and-customers (original saga) -> orders-and-customers-quarkus -> orders-and-customers-quarkus-integration-tests

To solve the issue, I needed to specify properties in both modules. Otherwise, if specify only in one place, no matter which one, the error appears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants