OGM + Mongodb Hibernate module error inside Wildfly 10

Asked

Viewed 196 times

1

I am in need of a help to set up Wildfly 10 with Hibernate OGM and Mongodb... I have the following error:

11:13:17,164 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.module.service."deployment.brx-plataforma.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.brx-plataforma.war".main: WFLYSRV0179: Failed to load module: deployment.brx-plataforma.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate:ogm
at org.jboss.modules.Module.addPaths(Module.java:1093)
at org.jboss.modules.Module.link(Module.java:1449)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1477)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:225)
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68)
... 5 more

11:13:17,192 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "brx-plataforma.war")]) - failure description: {
"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.brx-plataforma.war\".main" => "org.jboss.msc.service.StartException in service jboss.module.service.\"deployment.brx-plataforma.war\".main: WFLYSRV0179: Failed to load module: deployment.brx-plataforma.war:main
Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate:ogm"},
"WFLYCTL0412: Required services that are not installed:" => ["jboss.module.service.\"deployment.brx-plataforma.war\".main"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined
}

There is no GMO hibernate module for mongoDB, there is no kkkkkkkkk GMO module...

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>br.com.brx</groupId>
<artifactId>brx-plataforma</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name>brx-plataforma</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.jboss.bom>10.0.0.Final</version.jboss.bom>
</properties>

<dependencyManagement>
    <dependencies>
        <!-- Configuracao tools jboss -->
        <dependency>
            <groupId>org.wildfly.bom</groupId>
            <artifactId>wildfly-javaee7-with-tools</artifactId>
            <version>${version.jboss.bom}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>


        <!-- Hibernate OGM - MongoDB -->
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-bom</artifactId>
            <version>5.0.4.Final</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

    </dependencies>
</dependencyManagement>

<dependencies>

    <!-- CDI -->
    <dependency>
        <groupId>javax.enterprise</groupId>
        <artifactId>cdi-api</artifactId>
        <scope>provided</scope>
    </dependency>

    <!--Jboss annotation -->
    <dependency>
        <groupId>org.jboss.spec.javax.annotation</groupId>
        <artifactId>jboss-annotations-api_1.2_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!--JAX-RS -->
    <dependency>
        <groupId>org.jboss.spec.javax.ws.rs</groupId>
        <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!--JPA -->
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.1-api</artifactId>
        <scope>provided</scope>
    </dependency>

    <!--EJB -->
    <dependency>
        <groupId>org.jboss.spec.javax.ejb</groupId>
        <artifactId>jboss-ejb-api_3.2_spec</artifactId>
        <scope>provided</scope>
    </dependency>

    <!--JUnit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>

    <!-- Hibernate OGM - MongoDB -->
    <dependency>
        <groupId>org.hibernate.ogm</groupId>
        <artifactId>hibernate-ogm-mongodb</artifactId>
    </dependency>



</dependencies>
<build>

    <!-- Maven - Java 8 -->
    <finalName>${project.artifactId}</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.0.2.Final</version>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <!-- Java EE 6 doesn't require web.xml, Maven needs to catch up! -->
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <version>2.8</version>
            <configuration>
                <version>6</version>
                <defaultLibBundleDir>lib</defaultLibBundleDir>
            </configuration>
        </plugin>
    </plugins>
</build>
<profiles>
    <profile>
        <id>default</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.4.3</version>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

In pom.xml the dependencies of Hibernate OGM and mongoDB are described.

Also follows the jboss-Deployment-Structure.xml configuration

<deployment>
    <dependencies>
        <module name="org.hibernate" slot="ogm" services="import" />
        <module name="org.hibernate.ogm.mongodb" services="import" />
        <module name="org.hibernate.search.orm" services="import" />
    </dependencies>
</deployment>

It also follows the persistence.xml structure

<?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="brx-plataforma" transaction-type="JTA">
    <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>

    <!-- Cadastro de usuario -->
    <class>br.com.brx.plataforma.cadastro.usuario.entity.Pessoa</class>
    <class>br.com.brx.plataforma.cadastro.usuario.entity.PessoaFisica</class>
    <class>br.com.brx.plataforma.cadastro.usuario.entity.PessoaJuridica</class>
    <class>br.com.brx.plataforma.cadastro.usuario.entity.Usuario</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="brxdb"/>
        <property name="hibernate.ogm.datastore.host" value="localhost"/>
        <property name="hibernate.ogm.datastore.port" value="27017"/>

    </properties>

</persistence-unit>

I am using wildfly-10.1.0.Final and inside it there is the modules folder... I would like to know how I should proceed... is it necessary to put some module inside the server right? But I’ve tried, I don’t know if I’m missing the folder structure.

Thanks for your help

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.