Tutorial with mongodb

Hello, I have 2 questions:
1- there is an up-to-date tutorial for a basic usage of hibernate OGM with Mongodb?
2- I tried to run this project:


from this tutorial: http://www.mastertheboss.com/javaee/mongodb/using-jpa-with-mongodb-and-wildfly

I get this error:

13:52:41,110 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."hibernateogm-mongo.war".FIRST_MODULE_USE: org.jboss.msc.service.StartException in service jboss.deployment.unit."hibernateogm-mongo.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "hibernateogm-mongo.war"
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:151)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0027: Persistence provider module load error org.hibernate.ogm (class org.hibernate.ogm.jpa.HibernateOgmPersistence)
	at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:991)
	at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.addPuService(PersistenceUnitServiceHandler.java:266)
	at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.handleWarDeployment(PersistenceUnitServiceHandler.java:206)
	at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.deploy(PersistenceUnitServiceHandler.java:134)
	at org.jboss.as.jpa.processor.PersistenceBeginInstallProcessor.deploy(PersistenceBeginInstallProcessor.java:52)
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)
	... 8 more
Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate.ogm
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:294)
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
	at org.jboss.as.jpa.persistenceprovider.PersistenceProviderLoader.loadProviderModuleByName(PersistenceProviderLoader.java:65)
	at org.jboss.as.jpa.processor.PersistenceUnitServiceHandler.lookupProvider(PersistenceUnitServiceHandler.java:987)
	... 13 more

13:52:41,976 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-2) ISPN000128: Infinispan version: Infinispan 'Estrella Galicia' 9.3.1.Final
13:52:42,329 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 72) WFLYCLINF0002: Started client-mappings cache from ejb container
13:52:42,533 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 73) WFLYUT0021: Registered web context: '/wildflyDynamicProject' for server 'default-server'
13:52:42,543 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "hibernateogm-mongo.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"hibernateogm-mongo.war\".FIRST_MODULE_USE" => "WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment \"hibernateogm-mongo.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYJPA0027: Persistence provider module load error org.hibernate.ogm (class org.hibernate.ogm.jpa.HibernateOgmPersistence)
    Caused by: org.jboss.modules.ModuleNotFoundException: org.hibernate.ogm"}}
13:52:42,567 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 42) WFLYSRV0010: Deployed "wildflyDynamicProject.war" (runtime-name : "wildflyDynamicProject.war")
13:52:42,570 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 42) WFLYSRV0010: Deployed "hibernateogm-mongo.war" (runtime-name : "hibernateogm-mongo.war")
13:52:42,604 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."hibernateogm-mongo.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "hibernateogm-mongo.war"

13:52:42,786 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
13:52:42,790 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9991/management
13:52:42,790 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9991
13:52:42,791 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 14.0.1.Final (WildFly Core 6.0.2.Final) started (with errors) in 13355ms - Started 417 of 603 services (1 services failed or missing dependencies, 328 services are lazy, passive or on-demand)
14:06:05,847 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 2) WFLYUT0022: Unregistered web context: '/wildflyDynamicProject' from server 'default-server'
14:06:06,285 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment wildflyDynamicProject.war (runtime-name: wildflyDynamicProject.war) in 509ms
14:06:06,627 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0009: Undeployed "wildflyDynamicProject.war" (runtime-name: "wildflyDynamicProject.war")
14:06:06,628 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."hibernateogm-mongo.war".FIRST_MODULE_USE: WFLYSRV0153: Failed to process phase FIRST_MODULE_USE of deployment "hibernateogm-mongo.war"

14:06:11,640 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) WFLYDS0004: Found wildflyDynamicProject.war in deployment directory. To trigger deployment create a file called wildflyDynamicProject.war.dodeploy

My POM

<?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>com.packtpub.mongo.chapter4</groupId>
    <artifactId>javaee7-mongodb</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>hibernateogm-mongo</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.jboss.bom>8.2.0.Final</version.jboss.bom>
    </properties>
    
   <repositories>
		<repository>
			<id>JBoss Repository</id>
			<url>https://repository.jboss.org/nexus/content/groups/public/</url>
		</repository>
	</repositories>

	<dependencyManagement>
		<dependencies>
                  
			<dependency>
				<groupId>org.wildfly.bom</groupId>
				<artifactId>jboss-javaee-7.0-with-all</artifactId>
				<version>${version.jboss.bom}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
                        
                        <!--
                         <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-search-orm</artifactId>
                <version>4.2.0.Beta1</version>
            </dependency>-->
                         <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-bom</artifactId>
            <type>pom</type>
            <version>4.2.0.Beta1</version>
            <scope>import</scope>
        </dependency>
        
		</dependencies>
	</dependencyManagement>
	<dependencies>
            <!--
            <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
        </dependency>
        -->
            <!--
<dependency>
    <groupId>org.mongodb.morphia</groupId>
    <artifactId>morphia</artifactId>
 
    <version>0.111</version>
</dependency>

 
<dependency>
    <groupId>cglib</groupId>
    <artifactId>cglib-nodep</artifactId>
    <version>[2.1_3,)</version>
    <type>jar</type>
    <optional>true</optional>
</dependency>
<dependency>
    <groupId>com.thoughtworks.proxytoys</groupId>
    <artifactId>proxytoys</artifactId>
    <version>1.0</version>
    <type>jar</type>
    <optional>true</optional>
</dependency>
-->

          
<dependency>
    <groupId>org.hibernate.ogm</groupId>
    <artifactId>hibernate-ogm-mongodb</artifactId>
</dependency>

 



<!--
    <dependency>
        <groupId>org.hibernate.ogm</groupId>
        <artifactId>hibernate-ogm-infinispan</artifactId>
    </dependency>
    -->
    <!--
 <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.6</version>
        </dependency>
        -->
    <!-- standard APIs dependencies - provided in a Java EE container 
 <dependency>
    <groupId>org.hibernate.javax.persistence</groupId>
    <artifactId>hibernate-jpa-2.1-api</artifactId>
</dependency> -->

<!--
    <dependency>
        <groupId>org.jboss.spec.javax.transaction</groupId>
        <artifactId>jboss-transaction-api_1.1_spec</artifactId>
        <version>1.0.0.Final</version>
        <scope>provided</scope>
    </dependency>
-->
    
    
    
    <!-- JBoss Transactions dependency 
    <dependency>
        <groupId>org.jboss.jbossts</groupId>
        <artifactId>jbossjta</artifactId>
       
    </dependency>
    
        -->
    <!--
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>2.13.1</version> 
        </dependency>
-->

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

        <dependency>
            <groupId>org.jboss.spec.javax.faces</groupId>
            <artifactId>jboss-jsf-api_2.2_spec</artifactId>
            <scope>provided</scope>
            <!-- <version>2.2.0</version> -->
        </dependency>

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

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

		 
		 
		 
		 
		 
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongodb-driver-sync</artifactId>
        <version>3.9.0</version>
    </dependency>
		 

    </dependencies>
    <build>

        <finalName>${project.artifactId}</finalName>

        <plugins>

            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.0.2.Final</version>
            </plugin>
        </plugins>
    </build>
</project>

Sorry for the late answer, I was looking for some of the demos projects but I realized that they are quite old.
I will try to update them in the near future.

In the meanwhile, I created a branch in my Github repository: hibernate-demos/hibernate-ogm/nosql-with-hibernate-ogm-101/hibernate-ogm-demo-nosql-with-hibernate-ogm-101-part-3 at prova · DavideD/hibernate-demos · GitHub

This is a maven configured project that will create a war and deploy it on WildFly 13. To make the build work you need to use the settings-example.xml included in the root of the project:

mvn clean install -s settings-example.xml

The test will look for the generated war during the package phase.

Note that to work, WildFly 13 needs to be started with the property: -Dee8.preview.mode=true

I’m planning to create a better example in the near future to include in the main project but I hope this can help
for now.

Feel free to ask any question if you need help.

Cheers

1 Like

I’m pretty new to the whole Java ee env, so I’m sorry for the trivial questions:

  • In Eclipse I have Wildfly 14 as runtime environment. It is configured with a port offset because I have an NVIDIA gpu service running on 9990. I tried to build your project with

mvn clean install -s settings-example.xml

but I get the error:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.882 sec <<< FAILURE! - in org.hibernate.ogm.demos.ogm101.part3.rest.PersonsIT
org.hibernate.ogm.demos.ogm101.part3.rest.PersonsIT  Time elapsed: 1.88 sec  <<< ERROR!
org.jboss.arquillian.container.spi.client.container.LifecycleException: The port 9990 is already in use. It means that either the server might be already running or there is another process using port 9990.

so I assume maven didn’t target that Server, but your project uses some kind of embedded Wildfly 13, am I wrong? In this case I’m not clear where can I change the port…

  • which are the downsides of using Hibernate-ogm with Tomcat and not Widlfly? The final aim for me is to integrate some Mongodb capabilities (with Hibernate-ogm which have an API pretty similar to JPA) in an existing project which already uses JPA with mysql and runs on Tomcat.

Note: please, if you have some time to waste for me, answer each point in detail. It would be greatly appreciated, as I said I’m facing all kind of issues in Java ee, since I’m not that experieced, so any information is useful.

some update (but I would be glad if you would be so kind to answer my previous question…just to confirm what curretly I’m assuming but I’m not sure I’m right).

  1. The error in your project comes Arquillian Wilfly container, which I guess is an embedded Wildfly server, but there is something I do not understand: when I try to run your project from Eclipse I still have to select “Run on server” and select a Server Runtime. In this case, with Arquillian (which manage Wildfly 13 by itself), is my Wildfly 14 Eclipse runtime ignored during the project startup?
    EDIT: Or I simply cannot run this project like I used to do using “Run on Server” in Eclipse?

  2. Anyway searching around about the port conflict I found a working solution:
    in src\test\resources\arquillian.xml I added a VM param -Djboss.socket.binding.port-offset=2. Now the error I get is:

org.hibernate.ogm.demos.ogm101.part3.rest.PersonsIT  Time elapsed: 62.963 sec  <<< ERROR!
org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
	at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:168)
	at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:123)
	at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:179)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:137)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:133)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:208)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:64)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:181)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:70)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:111)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.util.concurrent.TimeoutException: Managed server was not started within [60] s
	at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:161)
	at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:123)
	at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:179)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:137)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:133)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:208)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:64)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:181)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:70)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:111)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

TL;DR:

  1. stop all running servers;
  2. mvn clean install -s settings-example.xml
  3. now you can run the unit tests from Eclipse with Run as unit tests (don’t clean the project first or it will delete the target folder with the server).

Explanation:
It’s not an embedded server, the build downloads the WildFly distribution and Arquillian starts and stop it. You could use a remote server but this example is configured to download a new server and add the required modules to it. You can see the server under the folder /target/wildfly-13.0.0.Final.
This is done using the wildfly-server-provisioning-maven-plugin.

I think it’s better if you stop already running servers before running the build and make sure that the maven build is successful.
Once you have built the project you can run the tests in Eclipse without issues. You don’t have to use the “Run on server” but simply “Run as Junit Tests”. Eclipse won’t download the server for you.

The project is configured to use the dependency wildfly-arquillian-container-managed, this means that it will look for a local stopped WildFly server and managed the itsd lifecycle. You need to stop already running servers (or change the port of the one used for tests like you did) if you don’t want problems.
If you want to use a different local server, you can update the arquillian.xml file and change the property

<property name="jbossHome">/path/local/wildfly</property>

to the path to you local server. Now it uses a variable to point to the downloaded one.

You can also run the tests on a remote, already running, server. In this case, you need to update the pom.xml
and replace the dependency wildfly-arquillian-container-managed with wildfly-arquillian-container-remote.
I haven’t try this yet, so you might need to update something else. I will make sure to create different profiles in the future to make the example clearer

Keep in mind that right now this example won’t work with WildFly 14, I just pushed a patch to fix this and it’s going to be released in the next Hibernate OGM version: https://github.com/hibernate/hibernate-ogm/commit/51879a401e1e07c7faecb57fe4559b9c434a5112

It’s mainly a problem related to the modules, so, if you update the modules in your local WildFly, you should be able to make it work. But I would suggest to keep this for after you have already made it work on WildFly 13.
I will try to release a new version of OGM soon, so that this issue can be fixed.

I hope this answer all the questions, thanks a lot for you feedback by the way. Now I have a better idea
of what I need to update in the project example. Don’t esitate to ask for further clarifications.

In Eclipse I have Wildfly 14 as runtime environment. It is configured with a port offset because I have an NVIDIA gpu service running on 9990. I tried to build your project with

You probably need to update the arquillian.xml because, with the offset, Arquillian will need to connect to a different port.
I’ve found this question on SO: jboss7.x - Wildfly port offset not working with Arquillain - Stack Overflow

It seems you need to set, in the arquilliian.xml file, the variable:

<property name="managementPort">...</property>

But you need to check which one is the right port.
To be fair, this is more a question for the Arquillian forum: Space: Arquillian| JBoss.org Content Archive (Read Only)

EDIT: I forgot to mention that you can specify the offset as well in the arquillian.xml file. Check the property:
jvmArguments it contains the list of properties used when the server is started. You can add the one related to the offset port.

which are the downsides of using Hibernate-ogm with Tomcat and not Widlfly? The final aim for me is to integrate some Mongodb capabilities (with Hibernate-ogm which have an API pretty similar to JPA) in an existing project which already uses JPA with mysql and runs on Tomcat.

I prefer WildFly :slight_smile:

I’m not all that familiar with Tomcat, but I like the module system for dependencies in WildFly.
I think the main (non technical) reason to use WildFly in this case is that it’s the default server we use for integration tests and development and if you have something that doesn’t work, it’s easier for us to help you.

Also, this example already prepares the server for you with the provisioning-plugin and the server-provisioning.xml, I wouldn’t try to figure out how to do the same thing with Tomcat (but it is up to you).

If your WAR uses standard JEE, you should be able to deploy it on both servers once you have added the hibernate-ogm depdendencies to the container of your choice.

When I wrote the first answer I didn’t see the follow up message. I think I now answered all your questions.
If you need more help or I missed something, let me know.

Cheers

thanks a lot for taking the time to explain all this :slight_smile:

Also, this example already prepares the server for you with the provisioning-plugin and the server-provisioning.xml, I wouldn’t try to figure out how to do the same thing with Tomcat (but it is up to you).

This part is worring me a little: how can be so hard to switch application server?

But mostly important: In the post #4 I said I solved the port issue, but using the command mvn clean install -s settings-example.xml I still have this error:

org.hibernate.ogm.demos.ogm101.part3.rest.PersonsIT  Time elapsed: 62.68 sec  <<< ERROR!
org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
	at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:168)
	at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:123)
	at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:179)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:137)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:133)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:208)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:64)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:181)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:70)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:111)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.util.concurrent.TimeoutException: Managed server was not started within [60] s
	at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:161)
	at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:123)
	at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:179)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:137)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:133)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:208)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:133)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:64)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:181)
	at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:64)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:70)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:111)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

It looks like Arquillian cannot lauch Wildfly for some reason…

This part is worring me a little: how can be so hard to switch application server?

What I meant is that after the build you already have an already prepared server, why would decide to use a different one?

The error is too generic and you don’t say which server are you trying to launch:

  • Does it happen when you launch the build of the project I linked?
  • Did you change something?

Based on what you told me before, I would say that you added the offset to the server but you didn’t update the Arquillian management port correctly. Or, maybe, you are trying to launch WildFLy 14 but the dependencies in the project are for WildFly 13.

What I meant is that after the build you already have an already prepared server, why would decide to use a different one?

As I said in a previous post, I’m just playing around with Wildfly, the final aim for me is to add some Mongodb capabilities in an existing (big) project which uses JPA with mysql and Tomcat.

Does it happen when you launch the build of the project I linked?
Did you change something?

Yes.
No :slight_smile: . I’ve changed just the Arquillian configuration xml (adding the port offset and the field managementPort)

		<configuration>
            <property name="jbossHome">${jboss.home}</property>
            <property name="javaVmArguments">-Djboss.socket.binding.port-offset=2 -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -XX:+IgnoreUnrecognizedVMOptions</property>
			<property name="managementPort">9992</property>
        </configuration>

…Or, maybe, you are trying to launch WildFLy 14 but the dependencies in the project are for WildFly 13.

Wait, from your words I understood Arquillian search for active Wildfly instances OR if there isn’t any “starts and stops” Wildfly by its own (when I lauch mvn install). In the latter case, do I still need to start Wildfly manually?

Sorry for the confusion and for the trivial questions, as I said I’m not that skilled with Java ee…

As I said in a previous post, I’m just playing around with Wildfly, the final aim for me is to add some Mongodb capabilities in an existing (big) project which uses JPA with mysql and Tomcat.

I never tried so I don’t know. But if you are successful with Tomcat it would be nice if you could post your configuration somewhere for other people as well.

It doesn’t search for instances, it uses the server configured in the jbossHome property.

There isn’t, as far as I know, and if you didn’t change the dependencies in the example, you don’t need to.

To run the example, you never have to launch the server manually. Not even when running the tests from Eclipse. The only thing needed is that the server is in the specified path of the configuration (stopped).

Just to clarify, I mean there isn’t a way with the current arquillian plugins used in the example project.

thanks again for the answers, but the main problem remains (post #8).
I’ve just imported your project in Eclipse as Maven project and tried to run
mvn clean install -s settings-example.xml
and I get the error you see in post #8.

The only thing I’ve done is to add
-Djboss.socket.binding.port-offset=2
to <property name="javaVmArguments">
and <property name="managementPort">9992</property>

to arquillian configuration

I’m pretty sure that the problem is about the port, I’ve checked some posts about it and some users had luck using the port 9090. Have you tried different ports? Maybe an offset of 1000.

Except for that, the configuration seems right (I tested it on my machine), except that it is missing the -Dee8.preview.mode=true in the jvm arguments.

I cannot replicate the problem and I don’t have Windows so it’s hard for me to help you more than this.
I think you will have better luck asking to the arquillian forum: Space: Arquillian| JBoss.org Content Archive (Read Only)
Because the problem you are having is not related to Hibernate OGM.

That said, you don’t have to run the tests. You can use the following command:

mvn clean install -s settings-example.xml -DskipITs

This will skip the integration tests but prepare the server and the WAR. This way you have an example of the
configured server and the created WAR.
You will find the WAR and the server in /target folder

I don’t think it’s a port issue anymore: I’ve just noticed I previously messed up with the launch configurations and I missed the VM param -Dee8.preview.mode=true
If I add that param I get another kind of error:
Caused by: java.lang.ClassNotFoundException: javax.persistence.TableGenerators from [Module "org.hibernate.orm:5.3.6.Final" version 5.3.6.Final from local module loader @7a5d012c (finder: local module finder @3fb6a447 (roots: C:\eclipse\workspace\hibernate-ogm-demo-nosql-with-hibernate-ogm-101-part-3\target\wildfly-13.0.0.Final\modules,C:\eclipse\workspace\hibernate-ogm-demo-nosql-with-hibernate-ogm-101-part-3\target\wildfly-13.0.0.Final\modules\system\layers\base))]

That error should occur only if the server is started without the option. That property is used to tell WildFly 13 to use JPA 2.2 where javax.persistence.TableGenerators exists.

EDIT (More details): It also possible that you see a different error because this last one is thrown by the server at startup while the other one is thrown by arquillian when it tries to connect to the started server.

You should probably reset everything and only add the offset without touching anything else.

Ok, I deleted the project, reinstalled the OS, changed laptop (ok I’m joking about the last 2 :wink:), now I’m ready to restart.

First of all when I import the project in Eclipse I get the error:

No marketplace entries found to handle wildfly-server-provisioning-maven-plugin:1.2.9.Final:build in Eclipse. Please see Help for more information.

Is that normal?
I tried to set my own Maven installation in Eclipse like Gob00st said here eclipse - Error when importing Maven-GWT project ("No marketplace entries found to handle gwt-maven-plugin") - Stack Overflow
I didn’t solved. But I’m not sure this problem is related to Hibernate or Arquillian.

Beside that error in the pom, when I try to launch mvn clean install -s settings-example.xml
I still the the error
org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container

(I tried different port offsets)

@alfredopacino That’s a common problem with Eclipse, not really related to this plugin. From what I understand Eclipse has to have implement bindings for each and every Maven plugin in order for those to work, so as soon as you use a non-standard plugin, you get this kind of errors.

You will have to launch Maven separately to generate the WF server (as Davide suggested, I think). To ignore the plugin in Eclipse, add something like this to your POM:


        <profile>
            <id>eclipse</id>
            <activation>
                <property>
                    <!-- This is a trick to have the profile automatically activated by Eclipse -->
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <!--
                                This plugin's configuration is used in m2e only.
                                We want to configure this in a separate profile because the plugin doesn't really exist
                                and Maven will complain because it doesn't find it if executed outside of Eclipse.
                             -->
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.wildfly.build</groupId>
                                                <artifactId>wildfly-server-provisioning-maven-plugin</artifactId>
                                                <versionRange>[1.2.6.Final,)</versionRange>
                                                <goals>
                                                    <goal>build</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore />
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

I don’t know about the other error, but generally you should have a look at the WildFly logs (you should find them at target/mywildflydir/standalone/log/server.log). Look for the very first ERROR line: WildFly tends to spout many cascading errors when something wrong happens during bootstrap, and often only the first error is really relevant.