Kotlin Lagom 服务的 PersistenceException
PersistenceException at Kotlin Lagom service
当服务在 kube 启动时,我有错误:
2020-09-16T22:01:17.370+0300 [warn] com.lightbend.lagom.internal.javadsl.persistence.jpa.JpaSessionImpl [] - Exception while initializing JPA EntityManagerFactory
javax.persistence.PersistenceException: No Persistence provider for EntityManager named defaultPersistenceUnit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at com.lightbend.lagom.internal.javadsl.persistence.jpa.JpaSessionImpl.lambda$createEntityManagerFactory(JpaSessionImpl.java:107)
at com.lightbend.lagom.internal.javadsl.persistence.jpa.Retry.$anonfun$retry(Retry.scala:37)
at scala.concurrent.Future$.$anonfun$apply(Future.scala:659)
我有 lagom、kotlin、Hibernate。 运行 在 k8s。
Persistence.xml 在 /src/main.resources/META-INF
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<non-jta-data-source>DefaultDS</non-jta-data-source>
Application.conf:
lagom.persistence.jpa {
# This must match the name in persistence.xml
persistence-unit = "defaultPersistenceUnit"
}
无法理解错误的原因。
您可能应该将 jpa.default="defaultPersistenceUnit"
添加到您的 application.conf
文件中。
当服务在 kube 启动时,我有错误:
2020-09-16T22:01:17.370+0300 [warn] com.lightbend.lagom.internal.javadsl.persistence.jpa.JpaSessionImpl [] - Exception while initializing JPA EntityManagerFactory
javax.persistence.PersistenceException: No Persistence provider for EntityManager named defaultPersistenceUnit
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
at com.lightbend.lagom.internal.javadsl.persistence.jpa.JpaSessionImpl.lambda$createEntityManagerFactory(JpaSessionImpl.java:107)
at com.lightbend.lagom.internal.javadsl.persistence.jpa.Retry.$anonfun$retry(Retry.scala:37)
at scala.concurrent.Future$.$anonfun$apply(Future.scala:659)
我有 lagom、kotlin、Hibernate。 运行 在 k8s。 Persistence.xml 在 /src/main.resources/META-INF
<persistence-unit name="defaultPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<non-jta-data-source>DefaultDS</non-jta-data-source>
Application.conf:
lagom.persistence.jpa {
# This must match the name in persistence.xml
persistence-unit = "defaultPersistenceUnit"
}
无法理解错误的原因。
您可能应该将 jpa.default="defaultPersistenceUnit"
添加到您的 application.conf
文件中。