gpt4 book ai didi

java - 如何让 hibernate-ogm 在 jboss eap 7.2 上工作?

转载 作者:行者123 更新时间:2023-12-01 18:20:24 25 4
gpt4 key购买 nike

pom.xml

<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-mongodb</artifactId>
<version>5.4.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.2.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.14.Final</version>
</dependency>

persistence.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="ogm-jpa"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<class>com.iexceed.mongopoc.entity.Breed</class>
<properties>
<property name="hibernate.ogm.datastore.provider"
value="mongodb" />
<property name="hibernate.ogm.datastore.host"
value="host" />
<property name="hibernate.ogm.datastore.username"
value="USERNAME" />
<property name="hibernate.ogm.datastore.password"
value="PASSWORD" />
<property name="hibernate.ogm.datastore.database"
value="admin" />
<property name="hibernate.ogm.datastore.port" value="27017"/>
</properties>
</persistence-unit>
</persistence>

我收到以下错误RuntimeException javax.persistence.PersistenceException:没有名为 ogm-jpa 的 EntityManager 的持久性提供程序

最佳答案

Blockquote

从 jbossstandalone.xml 文件中删除了以下子系统

<subsystem xmlns="urn:jboss:domain:jpa:1.1">
<jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
</subsystem>

关于java - 如何让 hibernate-ogm 在 jboss eap 7.2 上工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60302128/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com