我有一个具有休眠反应的 quarkus 项目。
当我尝试构建时,EntityManager 无法识别持久单元“datasource-cis”。
应用配置文件:
https://github.com/anborg/ws-quarkus/blob/main/config/application.yml
注入点(EntityManager):
我错过了什么?
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ cis ---
[INFO] Building jar: /Volumes/data01/projects/zorg/on-stove/ws-quarkus/target/cis-1.0.0-SNAPSHOT.jar
[INFO]
[INFO] --- quarkus-maven-plugin:2.3.1.Final:build (default) @ cis ---
[INFO] [org.jboss.threads] JBoss Threads version 3.4.2.Final
[WARNING] [io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor] Could not find a suitable persistence unit for model classes:
- io.quarkus.hibernate.reactive.panache.PanacheEntity
- io.quarkus.hibernate.reactive.panache.PanacheEntityBase
- model.WorkOrder
[WARNING] [io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor] Could not find any entities affected to the persistence unit 'datasource-cis'.
[INFO] [org.hibernate.Version] HHH000412: Hibernate ORM core version 5.6.0.Final
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.596 s
[INFO] Finished at: 2021-10-29T01:44:37-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:2.3.1.Final:build (default) on project cis: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManagerFactory and qualifiers [@Default]
[ERROR] - java member: io.quarkus.hibernate.reactive.runtime.ReactiveSessionFactoryProducer#emf
[ERROR] - declared on CLASS bean [types=[io.quarkus.hibernate.reactive.runtime.ReactiveSessionFactoryProducer, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkus.hibernate.reactive.runtime.ReactiveSessionFactoryProducer]
[ERROR] The following beans match by type, but none have matching qualifiers:
[ERROR] - Bean [class=org.hibernate.SessionFactory, qualifiers=[@Named(value = "datasource-cis"), @io.quarkus.hibernate.orm.PersistenceUnit(value = "datasource-cis"), @Any]]
[ERROR] at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1149)
[ERROR] at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:266)
[ERROR] at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
[ERROR] at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:418)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR] at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:829)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type javax.persistence.EntityManagerFactory and qualifiers [@Default]
[ERROR] - java member: io.quarkus.hibernate.reactive.runtime.ReactiveSessionFactoryProducer#emf
[ERROR] - declared on CLASS bean [types=[io.quarkus.hibernate.reactive.runtime.ReactiveSessionFactoryProducer, java.lang.Object], qualifiers=[@Default, @Any], target=io.quarkus.hibernate.reactive.runtime.ReactiveSessionFactoryProducer]
[ERROR] The following beans match by type, but none have matching qualifiers:
[ERROR] - Bean [class=org.hibernate.SessionFactory, qualifiers=[@Named(value = "datasource-cis"), @io.quarkus.hibernate.orm.PersistenceUnit(value = "datasource-cis"), @Any]]
[ERROR] at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:567)
[ERROR] at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:470)
[ERROR] at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:254)
[ERROR] ... 13 more
[ERROR] -> [Help 1]