简体   繁体   English

在Wildfly 10.1.0上为Mongodb持久性部署Hibernate OGM时出现问题

[英]Problems deploying Hibernate OGM for Mongodb persistence on Wildfly 10.1.0

I am getting an error when deploying an application on Wildfly 10.1.0 when using a Hibernate OGM persistence unit for Mongodb. 当为Mongodb使用Hibernate OGM持久性单元时,在Wildfly 10.1.0上部署应用程序时出现错误。 After trying several combinations of modules and configuration, I am following the answer to this post . 试图模块和配置的几种组合后,我下面的答案, 这个帖子

I believe I have the modules organized correctly. 我相信我的模块组织正确。 The jboss-deployment-structure looks like this: jboss-deployment-结构看起来像这样:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
  <deployment>
    <dependencies>
      <module name="org.hibernate.ogm.mongodb" services="import" />
      <module name="org.hibernate.search.orm" services="import" />
      <module name="org.hibernate.search.engine" slot="5.6" services="import" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>

My persistence unit looks like this: 我的持久性单元如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<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-mongodb" transaction-type="JTA">
    <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
    <class>org.secomm.authenticator.persistence.ServerVault</class>
    <properties>
      <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
      <property name="hibernate.ogm.datastore.provider" value="mongodb" />
      <property name="hibernate.ogm.datastore.database" value="mydatabase"/>
      <property name="hibernate.ogm.datastore.host" value="myhost"/>
      <property name="hibernate.ogm.datastore.username" value="***" />
      <property name="hibernate.ogm.datastore.password" value="***"/>
    </properties>
  </persistence-unit>
</persistence>

I get an error indicating that the Hibernate 5.1 module is missing: 我收到一条错误消息,指示缺少Hibernate 5.1模块:

ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "secomm-enterprise-ear-1.0-SNAPSHOT.ear")]) - failure description: {
"WFLYCTL0080: Failed services" => {
    "jboss.module.service.\"deployment.secomm-enterprise-ear-1.0-SNAPSHOT.ear.secomm-api-rest-1.0-SNAPSHOT.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.secomm-enterprise-ear-1.0-SNAPSHOT.ear.secomm-api-rest-1.0-SNAPSHOT.war\".main: WFLYSRV0179: Failed to load module: deployment.secomm-enterprise-ear-1.0-SNAPSHOT.ear.secomm-api-rest-1.0-SNAPSHOT.war:main
Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate:5.1"

There doesn't seem to be a single, coherent hibernate 5.1 modules package. 似乎没有一个单一的,一致的休眠5.1模块包。 If I start trying to add in the Hibernate modules manually, it leads down a rabbit hole of search engine dependencies that ends up giving me an error about a SPI integrator class not being a subtype. 如果我开始尝试手动添加Hibernate模块,则会导致搜索引擎依赖项陷入困境,最终给我一个关于SPI集成器类不是子类型的错误。

Any help with this is appreciated. 任何帮助,不胜感激。

This is the module you have to download and add to WildFly: 这是您必须下载并添加到WildFly的模块:

<groupId>org.hibernate</groupId> <artifactId>hibernate-orm-modules</artifactId> <version>5.1.10.Final</version> <classifier>wildfly-10-dist</classifier>

Extract it in $WILDFLY_HOME/modules and it should work. 将其解压缩到$WILDFLY_HOME/modules ,它应该可以工作。 If you are not using maven, you can download it from the JBoss Nexus repository: https://repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate-orm-modules/5.1.10.Final/hibernate-orm-modules-5.1.10.Final-wildfly-10-dist.zip 如果您不使用Maven,则可以从JBoss Nexus存储库下载它: https : //repository.jboss.org/nexus/content/groups/public/org/hibernate/hibernate-orm-modules/5.1.10.Final /hibernate-orm-modules-5.1.10.Final-wildfly-10-dist.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM