Run Hibernate OGM with WildFly and MongoDB as a beginner

Hello,

I am currently studying computer science at university and would like to connect a Java application, which I wrote last semester, to a database and run the application on a application server.
My choice of database fell on MongoDB. The database is hosted via MongoDB Atlas online and is therefore not local. I wanted to use a ORM to get around working with JDBC. Since MongoDB is a NoSQL database, Hibernate OGM seemed to be the better choice. As application server I chose WildFly.
Unfortunately, I have no experience with ORMs or Application Servers and therefore encountered some problems.

At the moment I fail to include the required MongoDB feature pack (Documentation Heading 4.5.1.) and move my properties out of the persistence.xml into a WildFly NoSQL subsystem (Documentation Heading 4.6.1.). I don’t know where to put the subsystem code snippet and when I put it into the standalone.xml, the server is telling me that the subsystem is a unexpected element:

148:     <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
149:     <subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
150: <subsystem xmlns="urn:jboss:domain:mongodb:1.0">
   ^^^^ Unexpected element '{urn:jboss:domain:mongodb:1.0}subsystem'

151: <mongo name="default" id="mongodb" jndi-name="java:jboss/mongodb/client" database="mongodb" module="org.hibernate.ogm.mongodb">
152:     <host name="default" outbound-socket-binding-ref="mongodb"/>
153:     <properties name="default">

> ParseError at [row,col]:[150,3]
> Message: Unexpected element '{urn:jboss:domain:mongodb:1.0}subsystem'

16:23:39,036 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
	at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)
	at org.jboss.as.server.ServerService.boot(ServerService.java:385)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:374)
	at java.lang.Thread.run(Thread.java:748)

16:23:39,038 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.

Used components:

  • Java 1.8
  • Maven
  • IntelliJ IDEA (I start the server from here)
  • MongoDB 4.0.10 (Hosted via MongoDB Atlas)
  • Hibernate OGM 5.4.1.Final
  • WildFly 16.0.0.Final

project structure

I didn’t create the jboss-deployment-structure.xml because I added the dependencies in the pom and it is written that that’s enough.

WildFly structure

I added the hibernate-ogm-featurepack-mongodb and hibernate-ogm-featurepack-core zip files manually to the modules in the hope that the server will start.
I think it’s enough to add them to the pom, but I don’t know.

server.log

2019-06-04 15:07:24,396 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final
2019-06-04 15:07:24,886 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.5.Final
2019-06-04 15:07:24,898 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
2019-06-04 15:07:25,063 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) starting
2019-06-04 15:07:25,064 DEBUG [org.jboss.as.config] (MSC service thread 1-2) Configured system properties:
	awt.toolkit = sun.awt.windows.WToolkit
	ee8.preview.mode = true
	file.encoding = Cp1252
	file.encoding.pkg = sun.io
	file.separator = \
	java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
	java.awt.printerjob = sun.awt.windows.WPrinterJob
	java.class.path = C:\wildfly-16.0.0.Final\jboss-modules.jar
	java.class.version = 52.0
	java.endorsed.dirs = C:\Program Files\Java\jdk1.8.0_181\jre\lib\endorsed
	java.ext.dirs = C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
	java.home = C:\Program Files\Java\jdk1.8.0_181\jre
	java.io.tmpdir = C:\Users\MARVIN~1\AppData\Local\Temp\
	java.library.path = C:\Program Files\Java\jdk1.8.0_181\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;c:\program files\graphicsmagick-1.3.30-q16;C:\Program Files\ImageMagick-7.0.8-Q16;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\Marvin Stickel\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\MongoDB\Server\4.0\bin;C:\apache-maven-3.6.1\bin;;C:\Users\Marvin Stickel\AppData\Local\Programs\Microsoft VS Code\bin;.
	java.runtime.name = Java(TM) SE Runtime Environment
	java.runtime.version = 1.8.0_181-b13
	java.specification.name = Java Platform API Specification
	java.specification.vendor = Oracle Corporation
	java.specification.version = 1.8
	java.util.logging.manager = org.jboss.logmanager.LogManager
	java.vendor = Oracle Corporation
	java.vendor.url = http://java.oracle.com/
	java.vendor.url.bug = http://bugreport.sun.com/bugreport/
	java.version = 1.8.0_181
	java.vm.info = mixed mode
	java.vm.name = Java HotSpot(TM) 64-Bit Server VM
	java.vm.specification.name = Java Virtual Machine Specification
	java.vm.specification.vendor = Oracle Corporation
	java.vm.specification.version = 1.8
	java.vm.vendor = Oracle Corporation
	java.vm.version = 25.181-b13
	javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder
	jboss.home.dir = C:\wildfly-16.0.0.Final
	jboss.host.name = ms-surfaceb
	jboss.modules.dir = C:\wildfly-16.0.0.Final\modules
	jboss.node.name = ms-surfaceb
	jboss.qualified.host.name = ms-surfaceb
	jboss.server.base.dir = C:\wildfly-16.0.0.Final\standalone
	jboss.server.config.dir = C:\wildfly-16.0.0.Final\standalone\configuration
	jboss.server.data.dir = C:\wildfly-16.0.0.Final\standalone\data
	jboss.server.deploy.dir = C:\wildfly-16.0.0.Final\standalone\data\content
	jboss.server.log.dir = C:\wildfly-16.0.0.Final\standalone\log
	jboss.server.name = ms-surfaceb
	jboss.server.persist.config = true
	jboss.server.temp.dir = C:\wildfly-16.0.0.Final\standalone\tmp
	line.separator = 

	logging.configuration = file:C:\wildfly-16.0.0.Final\standalone\configuration/logging.properties
	module.path = C:\wildfly-16.0.0.Final\modules
	org.jboss.boot.log.file = C:\wildfly-16.0.0.Final\standalone\log\server.log
	org.jboss.resolver.warning = true
	os.arch = amd64
	os.name = Windows 10
	os.version = 10.0
	path.separator = ;
	program.name = standalone.bat
	sun.arch.data.model = 64
	sun.boot.class.path = C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\classes
	sun.boot.library.path = C:\Program Files\Java\jdk1.8.0_181\jre\bin
	sun.cpu.endian = little
	sun.cpu.isalist = amd64
	sun.desktop = windows
	sun.io.unicode.encoding = UnicodeLittle
	sun.java.command = C:\wildfly-16.0.0.Final\jboss-modules.jar -mp C:\wildfly-16.0.0.Final\modules org.jboss.as.standalone -Djboss.home.dir=C:\wildfly-16.0.0.Final
	sun.java.launcher = SUN_STANDARD
	sun.jnu.encoding = Cp1252
	sun.management.compiler = HotSpot 64-Bit Tiered Compilers
	sun.os.patch.level = 
	user.country = DE
	user.dir = C:\wildfly-16.0.0.Final\bin
	user.home = C:\Users\Marvin Stickel
	user.language = de
	user.name = Marvin Stickel
	user.script = 
	user.timezone = Europe/Berlin
	user.variant = 

[...] The forum post was too long so I had to trim the full log

2019-06-04 15:07:32,093 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "FS-Java-0.1-SNAPSHOT" (runtime-name: "FS-Java-0.1-SNAPSHOT.war")
2019-06-04 15:07:57,037 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry xercesImpl.jar in /C:/Studium/WiSe 18-19/FS-Java/target/FS-Java-0.1-SNAPSHOT/WEB-INF/lib/xalan-2.7.0.jar  does not point to a valid jar for a Class-Path reference.
2019-06-04 15:07:57,038 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry xml-apis.jar in /C:/Studium/WiSe 18-19/FS-Java/target/FS-Java-0.1-SNAPSHOT/WEB-INF/lib/xalan-2.7.0.jar  does not point to a valid jar for a Class-Path reference.
2019-06-04 15:07:57,038 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry serializer.jar in /C:/Studium/WiSe 18-19/FS-Java/target/FS-Java-0.1-SNAPSHOT/WEB-INF/lib/xalan-2.7.0.jar  does not point to a valid jar for a Class-Path reference.
2019-06-04 15:07:57,485 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.module.service."deployment.FS-Java-0.1-SNAPSHOT.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.FS-Java-0.1-SNAPSHOT.war".main: WFLYSRV0179: Failed to load module: deployment.FS-Java-0.1-SNAPSHOT.war
	at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:116)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\wildfly-16.0.0.Final\modules\org\hibernate\ogm\mongodb\5.4\module.xml
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:339)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:295)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:256)
	at org.jboss.modules.LocalModuleFinder.parseModuleXmlFile(LocalModuleFinder.java:250)
	at org.jboss.modules.LocalModuleFinder.lambda$findModule$1(LocalModuleFinder.java:195)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:195)
	at org.jboss.modules.ModuleLoader.findModule0(ModuleLoader.java:693)
	at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:686)
	at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:496)
	at org.jboss.modules.DelegatingModuleLoader.preloadModule(DelegatingModuleLoader.java:57)
	at org.jboss.modules.Module.addPaths(Module.java:1252)
	at org.jboss.modules.Module.link(Module.java:1622)
	at org.jboss.modules.Module.relinkIfNecessary(Module.java:1650)
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:296)
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
	at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:93)
	... 8 more
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-mongodb}' (position: END_TAG seen ...    <artifact name="${org.hibernate.ogm:hibernate-ogm-mongodb}" />... @10:71) caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
	at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:1064)
	at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:950)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:710)
	at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:471)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:337)
	... 24 more
Caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
	at org.jboss.modules.maven.ArtifactCoordinates.fromString(ArtifactCoordinates.java:83)
	at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:1060)
	... 28 more

2019-06-04 15:07:57,492 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "FS-Java-0.1-SNAPSHOT")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.FS-Java-0.1-SNAPSHOT.war\".main" => "WFLYSRV0179: Failed to load module: deployment.FS-Java-0.1-SNAPSHOT.war
    Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\\wildfly-16.0.0.Final\\modules\\org\\hibernate\\ogm\\mongodb\\5.4\\module.xml
    Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-mongodb}' (position: END_TAG seen ...    <artifact name=\"${org.hibernate.ogm:hibernate-ogm-mongodb}\" />... @10:71) caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
    Caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}"}}
2019-06-04 15:07:57,495 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "FS-Java-0.1-SNAPSHOT.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.FS-Java-0.1-SNAPSHOT.war\".main" => "WFLYSRV0179: Failed to load module: deployment.FS-Java-0.1-SNAPSHOT.war
    Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\\wildfly-16.0.0.Final\\modules\\org\\hibernate\\ogm\\mongodb\\5.4\\module.xml
    Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-mongodb}' (position: END_TAG seen ...    <artifact name=\"${org.hibernate.ogm:hibernate-ogm-mongodb}\" />... @10:71) caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
    Caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}"}}
2019-06-04 15:07:57,967 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment FS-Java-0.1-SNAPSHOT (runtime-name: FS-Java-0.1-SNAPSHOT.war) in 470ms
2019-06-04 15:08:33,743 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0272: Suspending server
2019-06-04 15:08:33,745 INFO  [org.jboss.as.ejb3] (management-handler-thread - 1) WFLYEJB0493: EJB subsystem suspension complete
2019-06-04 15:08:33,751 INFO  [org.jboss.as.server] (Management Triggered Shutdown) WFLYSRV0241: Shutting down in response to management operation 'shutdown'
2019-06-04 15:08:33,758 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
2019-06-04 15:08:33,771 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
2019-06-04 15:08:33,779 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0019: Host default-host stopping
2019-06-04 15:08:33,789 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0019: Stopped Driver service with driver-name = h2
2019-06-04 15:08:33,844 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 77) WFLYCLINF0003: Stopped client-mappings cache from ejb container
2019-06-04 15:08:33,863 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0008: Undertow HTTP listener default suspending
2019-06-04 15:08:33,864 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0008: Undertow HTTPS listener https suspending

pom.xml

<?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.friedrichstickel.studentenkalender</groupId>
    <artifactId>FS-Java</artifactId>
    <version>0.1-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>FS-Java</name>

    <build>
        <plugins>
            <!-- Use Java 8 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <archive>
                        <manifestEntries>
                            <Dependencies>org.hibernate.ogm:5.4 services</Dependencies>
                            <Dependencies>org.hibernate.ogm.mongodb:5.4 services</Dependencies>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.wildfly.build</groupId>
                <artifactId>wildfly-server-provisioning-maven-plugin</artifactId>
                <version>1.2.11.Final</version>
                <executions>
                    <execution>
                        <id>server-provisioning</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <config-file>server-provisioning.xml</config-file>
                            <server-name>wildfly-with-hibernate-ogm</server-name>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

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

    <dependencies>
        <!-- Logging -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.11.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.11.2</version>
        </dependency>

        <!-- Unit Testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.4.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.4.2</version>
            <scope>test</scope>
        </dependency>

        <!-- Hibernate Search -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
            <version>5.11.1.Final</version>
        </dependency>
        <!-- Hibernate Standard APIs dependencies - provided in a Java EE container -->
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.2.Final</version>
        </dependency>
        <!-- Hibernate OGM MongoDB Support -->
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-mongodb</artifactId>
            <version>5.4.1.Final</version>
        </dependency>

        <!-- Transaction -->
        <dependency>
            <groupId>org.jboss.spec.javax.transaction</groupId>
            <artifactId>jboss-transaction-api_1.2_spec</artifactId>
            <version>1.1.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.jboss</groupId>
            <artifactId>jboss-transaction-spi</artifactId>
            <version>7.6.0.Final</version>
        </dependency>

        <!-- Add the Narayana Transactions Manager
             an implementation would be provided in a Java EE container,
             but this works nicely in Java SE as well -->
        <dependency>
            <groupId>org.jboss.narayana.jta</groupId>
            <artifactId>narayana-jta</artifactId>
            <version>5.9.5.Final</version>
            <scope>test</scope>
        </dependency>

        <!-- Server provisioning compatibility -->
        <dependency>
            <groupId>org.wildfly.build</groupId>
            <artifactId>wildfly-server-provisioning</artifactId>
            <version>1.2.11.Final</version>
        </dependency>

        <!-- WildFly Feature Packs -->
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-featurepack</artifactId>
            <version>5.4.1.Final</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-featurepack-core</artifactId>
            <version>5.4.1.Final</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-featurepack-mongodb</artifactId>
            <version>5.4.1.Final</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.wildfly.nosql</groupId>
            <artifactId>wildfly-mongodb-feature-pack</artifactId>
            <version>1.0.2.Final</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.wildfly.nosql</groupId>
            <artifactId>wildfly-mongodb-driver-feature-pack</artifactId>
            <version>1.0.2.Final</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>org.wildfly.nosql</groupId>
            <artifactId>wildfly-mongodbsubsystem</artifactId>
            <version>1.0.2.Final</version>
        </dependency>

        <!-- Dropwizard -->
        <dependency>
            <groupId>io.dropwizard</groupId>
            <artifactId>dropwizard-core</artifactId>
            <version>1.3.12</version>
        </dependency>
    </dependencies>
</project>

server-provisioning.xml

<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1">
    <feature-packs>
        <feature-pack
                groupId="org.hibernate.ogm"
                artifactId="hibernate-ogm-featurepack-mongodb"
                version="5.4.1.Final" />
    </feature-packs>
</server-provisioning>

persistence.xml

<?xml version="1.0"?>
<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="com.friedrichstickel.studentenkalender" transaction-type="JTA">
        <!-- Use Hibernate OGM as JPA provider -->
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>

        <properties>
            <!-- The JTA platform to use - JBossAS for the JBoss/WildFly Application Server -->
            <property name="hibernate.transaction.jta.platform" value="JBossAS"/>
            <!-- Use MongoDB as datastore provider -->
            <property name="hibernate.ogm.datastore.provider" value="mongodb"/>
            <property name="hibernate.connection.resource" value="java:jboss/mongodb/client"/>
        </properties>
    </persistence-unit>
</persistence>

Full server.log:

2019-06-04 15:07:24,396 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final
2019-06-04 15:07:24,886 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.5.Final
2019-06-04 15:07:24,898 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
2019-06-04 15:07:25,063 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) starting
2019-06-04 15:07:25,064 DEBUG [org.jboss.as.config] (MSC service thread 1-2) Configured system properties:
	awt.toolkit = sun.awt.windows.WToolkit
	ee8.preview.mode = true
	file.encoding = Cp1252
	file.encoding.pkg = sun.io
	file.separator = \
	java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
	java.awt.printerjob = sun.awt.windows.WPrinterJob
	java.class.path = C:\wildfly-16.0.0.Final\jboss-modules.jar
	java.class.version = 52.0
	java.endorsed.dirs = C:\Program Files\Java\jdk1.8.0_181\jre\lib\endorsed
	java.ext.dirs = C:\Program Files\Java\jdk1.8.0_181\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
	java.home = C:\Program Files\Java\jdk1.8.0_181\jre
	java.io.tmpdir = C:\Users\MARVIN~1\AppData\Local\Temp\
	java.library.path = C:\Program Files\Java\jdk1.8.0_181\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;c:\program files\graphicsmagick-1.3.30-q16;C:\Program Files\ImageMagick-7.0.8-Q16;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Users\Marvin Stickel\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\MongoDB\Server\4.0\bin;C:\apache-maven-3.6.1\bin;;C:\Users\Marvin Stickel\AppData\Local\Programs\Microsoft VS Code\bin;.
	java.runtime.name = Java(TM) SE Runtime Environment
	java.runtime.version = 1.8.0_181-b13
	java.specification.name = Java Platform API Specification
	java.specification.vendor = Oracle Corporation
	java.specification.version = 1.8
	java.util.logging.manager = org.jboss.logmanager.LogManager
	java.vendor = Oracle Corporation
	java.vendor.url = http://java.oracle.com/
	java.vendor.url.bug = http://bugreport.sun.com/bugreport/
	java.version = 1.8.0_181
	java.vm.info = mixed mode
	java.vm.name = Java HotSpot(TM) 64-Bit Server VM
	java.vm.specification.name = Java Virtual Machine Specification
	java.vm.specification.vendor = Oracle Corporation
	java.vm.specification.version = 1.8
	java.vm.vendor = Oracle Corporation
	java.vm.version = 25.181-b13
	javax.management.builder.initial = org.jboss.as.jmx.PluggableMBeanServerBuilder
	jboss.home.dir = C:\wildfly-16.0.0.Final
	jboss.host.name = ms-surfaceb
	jboss.modules.dir = C:\wildfly-16.0.0.Final\modules
	jboss.node.name = ms-surfaceb
	jboss.qualified.host.name = ms-surfaceb
	jboss.server.base.dir = C:\wildfly-16.0.0.Final\standalone
	jboss.server.config.dir = C:\wildfly-16.0.0.Final\standalone\configuration
	jboss.server.data.dir = C:\wildfly-16.0.0.Final\standalone\data
	jboss.server.deploy.dir = C:\wildfly-16.0.0.Final\standalone\data\content
	jboss.server.log.dir = C:\wildfly-16.0.0.Final\standalone\log
	jboss.server.name = ms-surfaceb
	jboss.server.persist.config = true
	jboss.server.temp.dir = C:\wildfly-16.0.0.Final\standalone\tmp
	line.separator = 

	logging.configuration = file:C:\wildfly-16.0.0.Final\standalone\configuration/logging.properties
	module.path = C:\wildfly-16.0.0.Final\modules
	org.jboss.boot.log.file = C:\wildfly-16.0.0.Final\standalone\log\server.log
	org.jboss.resolver.warning = true
	os.arch = amd64
	os.name = Windows 10
	os.version = 10.0
	path.separator = ;
	program.name = standalone.bat
	sun.arch.data.model = 64
	sun.boot.class.path = C:\Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_181\jre\classes
	sun.boot.library.path = C:\Program Files\Java\jdk1.8.0_181\jre\bin
	sun.cpu.endian = little
	sun.cpu.isalist = amd64
	sun.desktop = windows
	sun.io.unicode.encoding = UnicodeLittle
	sun.java.command = C:\wildfly-16.0.0.Final\jboss-modules.jar -mp C:\wildfly-16.0.0.Final\modules org.jboss.as.standalone -Djboss.home.dir=C:\wildfly-16.0.0.Final
	sun.java.launcher = SUN_STANDARD
	sun.jnu.encoding = Cp1252
	sun.management.compiler = HotSpot 64-Bit Tiered Compilers
	sun.os.patch.level = 
	user.country = DE
	user.dir = C:\wildfly-16.0.0.Final\bin
	user.home = C:\Users\Marvin Stickel
	user.language = de
	user.name = Marvin Stickel
	user.script = 
	user.timezone = Europe/Berlin
	user.variant = 
2019-06-04 15:07:25,065 DEBUG [org.jboss.as.config] (MSC service thread 1-2) VM Arguments: -Dprogram.name=standalone.bat -Dee8.preview.mode=true -Dorg.jboss.boot.log.file=C:\wildfly-16.0.0.Final\standalone\log\server.log -Dlogging.configuration=file:C:\wildfly-16.0.0.Final\standalone\configuration/logging.properties 
2019-06-04 15:07:26,243 INFO  [org.wildfly.security] (ServerService Thread Pool -- 27) ELY00001: WildFly Elytron version 1.8.0.Final
2019-06-04 15:07:27,020 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/core-service=management/management-interface=http-interface' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
2019-06-04 15:07:27,061 INFO  [org.jboss.as.controller.management-deprecated] (ServerService Thread Pool -- 15) WFLYCTL0028: Attribute 'security-realm' in the resource at address '/subsystem=undertow/server=default-server/https-listener=https' is deprecated, and may be removed in a future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.
2019-06-04 15:07:27,178 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0039: Creating http management service using socket-binding (management-http)
2019-06-04 15:07:27,201 INFO  [org.xnio] (MSC service thread 1-5) XNIO version 3.6.5.Final
2019-06-04 15:07:27,216 INFO  [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.6.5.Final
2019-06-04 15:07:27,345 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 42) WFLYJCA0004: Deploying JDBC-compliant driver class org.h2.Driver (version 1.4)
2019-06-04 15:07:27,400 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
2019-06-04 15:07:27,417 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 49) WFLYCLINF0001: Activating Infinispan subsystem.
2019-06-04 15:07:27,526 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 70) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
2019-06-04 15:07:27,537 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 72) WFLYWS0002: Activating WebServices Extension
2019-06-04 15:07:27,547 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 56) WFLYJSF0007: Activated the following JSF Implementations: [main]
2019-06-04 15:07:27,562 INFO  [org.jboss.as.jaxrs] (ServerService Thread Pool -- 51) WFLYRS0016: RESTEasy version 3.6.3.Final
2019-06-04 15:07:27,573 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 68) WFLYSEC0002: Activating Security Subsystem
2019-06-04 15:07:27,600 INFO  [org.jboss.as.security] (MSC service thread 1-7) WFLYSEC0001: Current PicketBox version=5.0.3.Final
2019-06-04 15:07:27,603 INFO  [org.wildfly.extension.microprofile.health.smallrye] (ServerService Thread Pool -- 59) WFLYHEALTH0001: Activating Eclipse MicroProfile Health Subsystem
2019-06-04 15:07:27,622 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 62) WFLYNAM0001: Activating Naming Subsystem
2019-06-04 15:07:27,642 INFO  [org.wildfly.extension.microprofile.config.smallrye._private] (ServerService Thread Pool -- 58) WFLYCONF0001: Activating WildFly MicroProfile Config Subsystem
2019-06-04 15:07:27,660 INFO  [org.wildfly.extension.microprofile.opentracing] (ServerService Thread Pool -- 61) WFLYTRACEXT0001: Activating MicroProfile OpenTracing Subsystem
2019-06-04 15:07:27,662 INFO  [org.wildfly.extension.microprofile.metrics.smallrye] (ServerService Thread Pool -- 60) WFLYMETRICS0001: Activating Eclipse MicroProfile Metrics Subsystem
2019-06-04 15:07:27,693 INFO  [org.jboss.as.connector] (MSC service thread 1-8) WFLYJCA0009: Starting JCA Subsystem (WildFly/IronJacamar 1.4.12.Final)
2019-06-04 15:07:27,705 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
2019-06-04 15:07:27,743 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) WFLYJCA0018: Started Driver service with driver-name = h2
2019-06-04 15:07:27,747 INFO  [io.smallrye.metrics] (MSC service thread 1-7) Converted [2] config entries and added [4] replacements
2019-06-04 15:07:27,755 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0003: Undertow 2.0.19.Final starting
2019-06-04 15:07:27,757 INFO  [io.smallrye.metrics] (MSC service thread 1-7) Converted [3] config entries and added [14] replacements
2019-06-04 15:07:27,812 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-8) WFLYMAIL0001: Bound mail session [java:jboss/mail/Default]
2019-06-04 15:07:27,814 INFO  [org.jboss.as.naming] (MSC service thread 1-8) WFLYNAM0003: Starting Naming Service
2019-06-04 15:07:28,156 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 71) WFLYUT0014: Creating file handler for path 'C:\wildfly-16.0.0.Final/welcome-content' with options [directory-listing: 'false', follow-symlink: 'false', case-sensitive: 'true', safe-symlink-paths: '[]']
2019-06-04 15:07:28,558 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 50) WFLYIO001: Worker 'default' has auto-configured to 8 core threads with 64 task threads based on your 4 available processors
2019-06-04 15:07:28,566 INFO  [org.jboss.as.ejb3] (MSC service thread 1-7) WFLYEJB0481: Strict pool slsb-strict-max-pool is using a max instance size of 64 (per class), which is derived from thread worker pool sizing.
2019-06-04 15:07:28,569 INFO  [org.jboss.as.ejb3] (MSC service thread 1-1) WFLYEJB0482: Strict pool mdb-strict-max-pool is using a max instance size of 16 (per class), which is derived from the number of CPUs on this host.
2019-06-04 15:07:28,626 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0012: Started server default-server.
2019-06-04 15:07:28,629 INFO  [org.jboss.as.patching] (MSC service thread 1-8) WFLYPAT0050: WildFly Full cumulative patch ID is: base, one-off patches include: none
2019-06-04 15:07:28,634 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-3) WFLYUT0018: Host default-host starting
2019-06-04 15:07:28,662 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 5.0.8.Final
2019-06-04 15:07:28,699 WARN  [org.jboss.as.domain.management.security] (MSC service thread 1-1) WFLYDM0111: Keystore C:\wildfly-16.0.0.Final\standalone\configuration\application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost
2019-06-04 15:07:28,738 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory C:\wildfly-16.0.0.Final\standalone\deployments
2019-06-04 15:07:28,755 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0006: Undertow HTTP listener default listening on 127.0.0.1:8080
2019-06-04 15:07:28,774 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "mongodb" (runtime-name: "mongodb-driver-3.10.1.jar")
2019-06-04 15:07:29,199 INFO  [org.jboss.as.ejb3] (MSC service thread 1-4) WFLYEJB0493: EJB subsystem suspension complete
2019-06-04 15:07:29,369 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) WFLYJCA0001: Bound data source [java:jboss/datasources/ExampleDS]
2019-06-04 15:07:29,726 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0006: Undertow HTTPS listener https listening on 127.0.0.1:8443
2019-06-04 15:07:29,823 INFO  [org.jboss.ws.common.management] (MSC service thread 1-4) JBWS022052: Starting JBossWS 5.2.4.Final (Apache CXF 3.2.7) 
2019-06-04 15:07:30,494 INFO  [org.infinispan.factories.GlobalComponentRegistry] (MSC service thread 1-3) ISPN000128: Infinispan version: Infinispan 'Infinity Minus ONE +2' 9.4.8.Final
2019-06-04 15:07:31,071 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 74) WFLYCLINF0002: Started client-mappings cache from ejb container
2019-06-04 15:07:31,366 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "mongodb" (runtime-name : "mongodb-driver-3.10.1.jar")
2019-06-04 15:07:31,450 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2019-06-04 15:07:31,452 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2019-06-04 15:07:31,452 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2019-06-04 15:07:31,453 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) started in 7528ms - Started 381 of 572 services (328 services are lazy, passive or on-demand)
2019-06-04 15:07:32,093 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "FS-Java-0.1-SNAPSHOT" (runtime-name: "FS-Java-0.1-SNAPSHOT.war")
2019-06-04 15:07:57,037 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry xercesImpl.jar in /C:/Studium/WiSe 18-19/FS-Java/target/FS-Java-0.1-SNAPSHOT/WEB-INF/lib/xalan-2.7.0.jar  does not point to a valid jar for a Class-Path reference.
2019-06-04 15:07:57,038 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry xml-apis.jar in /C:/Studium/WiSe 18-19/FS-Java/target/FS-Java-0.1-SNAPSHOT/WEB-INF/lib/xalan-2.7.0.jar  does not point to a valid jar for a Class-Path reference.
2019-06-04 15:07:57,038 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0059: Class Path entry serializer.jar in /C:/Studium/WiSe 18-19/FS-Java/target/FS-Java-0.1-SNAPSHOT/WEB-INF/lib/xalan-2.7.0.jar  does not point to a valid jar for a Class-Path reference.
2019-06-04 15:07:57,485 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.module.service."deployment.FS-Java-0.1-SNAPSHOT.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.FS-Java-0.1-SNAPSHOT.war".main: WFLYSRV0179: Failed to load module: deployment.FS-Java-0.1-SNAPSHOT.war
	at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:116)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\wildfly-16.0.0.Final\modules\org\hibernate\ogm\mongodb\5.4\module.xml
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:339)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:295)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:256)
	at org.jboss.modules.LocalModuleFinder.parseModuleXmlFile(LocalModuleFinder.java:250)
	at org.jboss.modules.LocalModuleFinder.lambda$findModule$1(LocalModuleFinder.java:195)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:195)
	at org.jboss.modules.ModuleLoader.findModule0(ModuleLoader.java:693)
	at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:686)
	at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:496)
	at org.jboss.modules.DelegatingModuleLoader.preloadModule(DelegatingModuleLoader.java:57)
	at org.jboss.modules.Module.addPaths(Module.java:1252)
	at org.jboss.modules.Module.link(Module.java:1622)
	at org.jboss.modules.Module.relinkIfNecessary(Module.java:1650)
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:296)
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:280)
	at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:93)
	... 8 more
Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-mongodb}' (position: END_TAG seen ...    <artifact name="${org.hibernate.ogm:hibernate-ogm-mongodb}" />... @10:71) caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
	at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:1064)
	at org.jboss.modules.xml.ModuleXmlParser.parseResources(ModuleXmlParser.java:950)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:710)
	at org.jboss.modules.xml.ModuleXmlParser.parseDocument(ModuleXmlParser.java:471)
	at org.jboss.modules.xml.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:337)
	... 24 more
Caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
	at org.jboss.modules.maven.ArtifactCoordinates.fromString(ArtifactCoordinates.java:83)
	at org.jboss.modules.xml.ModuleXmlParser.parseArtifact(ModuleXmlParser.java:1060)
	... 28 more

2019-06-04 15:07:57,492 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "FS-Java-0.1-SNAPSHOT")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.FS-Java-0.1-SNAPSHOT.war\".main" => "WFLYSRV0179: Failed to load module: deployment.FS-Java-0.1-SNAPSHOT.war
    Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\\wildfly-16.0.0.Final\\modules\\org\\hibernate\\ogm\\mongodb\\5.4\\module.xml
    Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-mongodb}' (position: END_TAG seen ...    <artifact name=\"${org.hibernate.ogm:hibernate-ogm-mongodb}\" />... @10:71) caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
    Caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}"}}
2019-06-04 15:07:57,495 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "FS-Java-0.1-SNAPSHOT.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.FS-Java-0.1-SNAPSHOT.war\".main" => "WFLYSRV0179: Failed to load module: deployment.FS-Java-0.1-SNAPSHOT.war
    Caused by: org.jboss.modules.ModuleLoadException: Error loading module from C:\\wildfly-16.0.0.Final\\modules\\org\\hibernate\\ogm\\mongodb\\5.4\\module.xml
    Caused by: org.jboss.modules.xml.XmlPullParserException: Failed to add artifact '${org.hibernate.ogm:hibernate-ogm-mongodb}' (position: END_TAG seen ...    <artifact name=\"${org.hibernate.ogm:hibernate-ogm-mongodb}\" />... @10:71) caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}
    Caused by: java.lang.IllegalArgumentException: ${org.hibernate.ogm:hibernate-ogm-mongodb}"}}
2019-06-04 15:07:57,967 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment FS-Java-0.1-SNAPSHOT (runtime-name: FS-Java-0.1-SNAPSHOT.war) in 470ms
2019-06-04 15:08:33,743 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0272: Suspending server
2019-06-04 15:08:33,745 INFO  [org.jboss.as.ejb3] (management-handler-thread - 1) WFLYEJB0493: EJB subsystem suspension complete
2019-06-04 15:08:33,751 INFO  [org.jboss.as.server] (Management Triggered Shutdown) WFLYSRV0241: Shutting down in response to management operation 'shutdown'
2019-06-04 15:08:33,758 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) WFLYJCA0010: Unbound data source [java:jboss/datasources/ExampleDS]
2019-06-04 15:08:33,771 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) WFLYMAIL0002: Unbound mail session [java:jboss/mail/Default]
2019-06-04 15:08:33,779 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0019: Host default-host stopping
2019-06-04 15:08:33,789 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0019: Stopped Driver service with driver-name = h2
2019-06-04 15:08:33,844 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 77) WFLYCLINF0003: Stopped client-mappings cache from ejb container
2019-06-04 15:08:33,863 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) WFLYUT0008: Undertow HTTP listener default suspending
2019-06-04 15:08:33,864 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-5) WFLYUT0008: Undertow HTTPS listener https suspending

You can find a subsystem example in our integration tests:

        <subsystem xmlns="urn:jboss:domain:mongodb:1.0">
            <mongo name="default" id="mongodb" jndi-name="java:jboss/mongodb/client" database="mongodb" module="org.hibernate.ogm.mongodb">
                <host name="default" outbound-socket-binding-ref="mongodb"/>
                <properties name="default">
                    <property name="writeConcern" value="ACKNOWLEDGED"/>
                    <property name="readConcern" value="LOCAL"/>
                </properties>
            </mongo>
      </subsystem>

    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
...
        <outbound-socket-binding name="mongodb">
            <remote-destination host="localhost" port="27018"/>
        </outbound-socket-binding>
    </socket-binding-group>

OGM will use it when you set the property hibernate.connection.resource.
We test the property in the following integration test: MongoDBWildFlyNoSQLMemberRegistrationIT

Let me know if this doesn’t help.

Thank you for the quick answer.

When I try to use the subsystem example, the run throws the exception Failed to parse configuration:

C:\wildfly-16.0.0.Final\bin\standalone.bat
"C:\Program Files\Java\jdk1.8.0_181\bin\java.exe" -Dfile.encoding=windows-1252 -classpath "C:\Users\Marvin Stickel\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.7479.19\lib\idea_rt.jar" com.intellij.rt.execution.CommandLineWrapper C:\Users\MARVIN~1\AppData\Local\Temp\idea_classpath1850472588 com.intellij.javaee.oss.process.JavaeeProcess 53333 com.intellij.javaee.oss.jboss.agent.WildFly11Agent
[2019-06-07 06:34:54,398] Artifact FS-Java:war exploded: Waiting for server connection to start artifact deployment...
Detected server admin port: 9990
Detected server http port: 8080
Calling "C:\wildfly-16.0.0.Final\bin\standalone.conf.bat"
"JAVA_OPTS already set in environment; overriding default settings with values: -Dee8.preview.mode=true "
Setting JAVA property to "C:\Program Files\Java\jdk1.8.0_181\bin\java"
===============================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: "C:\wildfly-16.0.0.Final"

  JAVA: "C:\Program Files\Java\jdk1.8.0_181\bin\java"

  JAVA_OPTS: "-Dprogram.name=standalone.bat -Dee8.preview.mode=true  "

===============================================================================

18:34:55,186 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final
18:34:56,077 INFO  [org.jboss.msc] (main) JBoss MSC version 1.4.5.Final
18:34:56,126 INFO  [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
18:34:56,347 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) starting
18:34:57,749 INFO  [org.wildfly.security] (ServerService Thread Pool -- 27) ELY00001: WildFly Elytron version 1.8.0.Final
18:34:58,483 ERROR [org.jboss.as.controller] (Controller Boot Thread) 

OPVDX001: Validation error in standalone.xml ---------------------------------
|
|  495:     </subsystem>
|  496:     <subsystem xmlns="urn:jboss:domain:weld:4.0"/>
|  497: <subsystem xmlns="urn:jboss:domain:mongodb:1.0">
|     ^^^^ Unexpected element '{urn:jboss:domain:mongodb:1.0}subsystem'
|
|  498:         <mongo name="default" id="mongodb" jndi-name="java:jboss/mongodb/client" database="mongodb" module="org.hibernate.ogm.mongodb">
|  499:             <host name="default" outbound-socket-binding-ref="mongodb"/>
|  500:             <properties name="default">
|
| The primary underlying error message was:
| > ParseError at [row,col]:[497,3]
| > Message: Unexpected element '{urn:jboss:domain:mongodb:1.0}subsystem'
|
|-------------------------------------------------------------------------------

18:34:58,484 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
	at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)
	at org.jboss.as.server.ServerService.boot(ServerService.java:385)
	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:374)
	at java.lang.Thread.run(Thread.java:748)

18:34:58,486 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
18:34:58,498 INFO  [org.jboss.as] (MSC service thread 1-4) WFLYSRV0050: WildFly Full 16.0.0.Final (WildFly Core 8.0.0.Final) stopped in 5ms
Disconnected from server

I also inserted the socket binding group, sorry I didn’t mention that. My full standalone.xml with the submodule and socket binding group in exactly the same position as in the integration test that throws the above exception:

<?xml version='1.0' encoding='UTF-8'?>

<server xmlns="urn:jboss:domain:10.0">
    <extensions>
        <extension module="org.jboss.as.clustering.infinispan"/>
        <extension module="org.jboss.as.connector"/>
        <extension module="org.jboss.as.deployment-scanner"/>
        <extension module="org.jboss.as.ee"/>
        <extension module="org.jboss.as.ejb3"/>
        <extension module="org.jboss.as.jaxrs"/>
        <extension module="org.jboss.as.jdr"/>
        <extension module="org.jboss.as.jmx"/>
        <extension module="org.jboss.as.jpa"/>
        <extension module="org.jboss.as.jsf"/>
        <extension module="org.jboss.as.logging"/>
        <extension module="org.jboss.as.mail"/>
        <extension module="org.jboss.as.naming"/>
        <extension module="org.jboss.as.pojo"/>
        <extension module="org.jboss.as.remoting"/>
        <extension module="org.jboss.as.sar"/>
        <extension module="org.jboss.as.security"/>
        <extension module="org.jboss.as.transactions"/>
        <extension module="org.jboss.as.webservices"/>
        <extension module="org.jboss.as.weld"/>
        <extension module="org.wildfly.extension.batch.jberet"/>
        <extension module="org.wildfly.extension.bean-validation"/>
        <extension module="org.wildfly.extension.core-management"/>
        <extension module="org.wildfly.extension.discovery"/>
        <extension module="org.wildfly.extension.ee-security"/>
        <extension module="org.wildfly.extension.elytron"/>
        <extension module="org.wildfly.extension.io"/>
        <extension module="org.wildfly.extension.microprofile.config-smallrye"/>
        <extension module="org.wildfly.extension.microprofile.health-smallrye"/>
        <extension module="org.wildfly.extension.microprofile.metrics-smallrye"/>
        <extension module="org.wildfly.extension.microprofile.opentracing-smallrye"/>
        <extension module="org.wildfly.extension.request-controller"/>
        <extension module="org.wildfly.extension.security.manager"/>
        <extension module="org.wildfly.extension.undertow"/>
    </extensions>
    <management>
        <security-realms>
            <security-realm name="ManagementRealm">
                <authentication>
                    <local default-user="$local" skip-group-loading="true"/>
                    <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
                </authentication>
                <authorization map-groups-to-roles="false">
                    <properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
                </authorization>
            </security-realm>
            <security-realm name="ApplicationRealm">
                <server-identities>
                    <ssl>
                        <keystore path="application.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password" generate-self-signed-certificate-host="localhost"/>
                    </ssl>
                </server-identities>
                <authentication>
                    <local default-user="$local" allowed-users="*" skip-group-loading="true"/>
                    <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
                </authentication>
                <authorization>
                    <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
                </authorization>
            </security-realm>
        </security-realms>
        <audit-log>
            <formatters>
                <json-formatter name="json-formatter"/>
            </formatters>
            <handlers>
                <file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
            </handlers>
            <logger log-boot="true" log-read-only="false" enabled="false">
                <handlers>
                    <handler name="file"/>
                </handlers>
            </logger>
        </audit-log>
        <management-interfaces>
            <http-interface security-realm="ManagementRealm">
                <http-upgrade enabled="true"/>
                <socket-binding http="management-http"/>
            </http-interface>
        </management-interfaces>
        <access-control provider="simple">
            <role-mapping>
                <role name="SuperUser">
                    <include>
                        <user name="$local"/>
                    </include>
                </role>
            </role-mapping>
        </access-control>
    </management>
    <profile>
        <subsystem xmlns="urn:jboss:domain:logging:6.0">
            <console-handler name="CONSOLE">
                <level name="INFO"/>
                <formatter>
                    <named-formatter name="COLOR-PATTERN"/>
                </formatter>
            </console-handler>
            <periodic-rotating-file-handler name="FILE" autoflush="true">
                <formatter>
                    <named-formatter name="PATTERN"/>
                </formatter>
                <file relative-to="jboss.server.log.dir" path="server.log"/>
                <suffix value=".yyyy-MM-dd"/>
                <append value="true"/>
            </periodic-rotating-file-handler>
            <logger category="com.arjuna">
                <level name="WARN"/>
            </logger>
            <logger category="io.jaegertracing.Configuration">
                <level name="WARN"/>
            </logger>
            <logger category="org.jboss.as.config">
                <level name="DEBUG"/>
            </logger>
            <logger category="sun.rmi">
                <level name="WARN"/>
            </logger>
            <root-logger>
                <level name="INFO"/>
                <handlers>
                    <handler name="CONSOLE"/>
                    <handler name="FILE"/>
                </handlers>
            </root-logger>
            <formatter name="PATTERN">
                <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
            </formatter>
            <formatter name="COLOR-PATTERN">
                <pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
            </formatter>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:batch-jberet:2.0">
            <default-job-repository name="in-memory"/>
            <default-thread-pool name="batch"/>
            <job-repository name="in-memory">
                <in-memory/>
            </job-repository>
            <thread-pool name="batch">
                <max-threads count="10"/>
                <keepalive-time time="30" unit="seconds"/>
            </thread-pool>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
        <subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
        <subsystem xmlns="urn:jboss:domain:datasources:5.0">
            <datasources>
                <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true" statistics-enabled="${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}">
                    <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
                    <driver>h2</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa</password>
                    </security>
                </datasource>
                <drivers>
                    <driver name="h2" module="com.h2database.h2">
                        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
                    </driver>
                </drivers>
            </datasources>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
            <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:discovery:1.0"/>
        <subsystem xmlns="urn:jboss:domain:ee:4.0">
            <spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
            <concurrent>
                <context-services>
                    <context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
                </context-services>
                <managed-thread-factories>
                    <managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
                </managed-thread-factories>
                <managed-executor-services>
                    <managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
                </managed-executor-services>
                <managed-scheduled-executor-services>
                    <managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
                </managed-scheduled-executor-services>
            </concurrent>
            <default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:ee-security:1.0"/>
        <subsystem xmlns="urn:jboss:domain:ejb3:5.0">
            <session-bean>
                <stateless>
                    <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
                </stateless>
                <stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
                <singleton default-access-timeout="5000"/>
            </session-bean>
            <pools>
                <bean-instance-pools>
                    <strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                    <strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
                </bean-instance-pools>
            </pools>
            <caches>
                <cache name="simple"/>
                <cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
            </caches>
            <passivation-stores>
                <passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
            </passivation-stores>
            <async thread-pool-name="default"/>
            <timer-service thread-pool-name="default" default-data-store="default-file-store">
                <data-stores>
                    <file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
                </data-stores>
            </timer-service>
            <remote connector-ref="http-remoting-connector" thread-pool-name="default">
                <channel-creation-options>
                    <option name="READ_TIMEOUT" value="${prop.remoting-connector.read.timeout:20}" type="xnio"/>
                    <option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
                </channel-creation-options>
            </remote>
            <thread-pools>
                <thread-pool name="default">
                    <max-threads count="10"/>
                    <keepalive-time time="100" unit="milliseconds"/>
                </thread-pool>
            </thread-pools>
            <default-security-domain value="other"/>
            <default-missing-method-permissions-deny-access value="true"/>
            <statistics enabled="${wildfly.ejb3.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
            <log-system-exceptions value="true"/>
        </subsystem>
        <subsystem xmlns="urn:wildfly:elytron:6.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
            <providers>
                <aggregate-providers name="combined-providers">
                    <providers name="elytron"/>
                    <providers name="openssl"/>
                </aggregate-providers>
                <provider-loader name="elytron" module="org.wildfly.security.elytron"/>
                <provider-loader name="openssl" module="org.wildfly.openssl"/>
            </providers>
            <audit-logging>
                <file-audit-log name="local-audit" path="audit.log" relative-to="jboss.server.log.dir" format="JSON"/>
            </audit-logging>
            <security-domains>
                <security-domain name="ApplicationDomain" default-realm="ApplicationRealm" permission-mapper="default-permission-mapper">
                    <realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
                    <realm name="local"/>
                </security-domain>
                <security-domain name="ManagementDomain" default-realm="ManagementRealm" permission-mapper="default-permission-mapper">
                    <realm name="ManagementRealm" role-decoder="groups-to-roles"/>
                    <realm name="local" role-mapper="super-user-mapper"/>
                </security-domain>
            </security-domains>
            <security-realms>
                <identity-realm name="local" identity="$local"/>
                <properties-realm name="ApplicationRealm">
                    <users-properties path="application-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ApplicationRealm"/>
                    <groups-properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
                </properties-realm>
                <properties-realm name="ManagementRealm">
                    <users-properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ManagementRealm"/>
                    <groups-properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
                </properties-realm>
            </security-realms>
            <mappers>
                <simple-permission-mapper name="default-permission-mapper" mapping-mode="first">
                    <permission-mapping>
                        <principal name="anonymous"/>
                        <permission-set name="default-permissions"/>
                    </permission-mapping>
                    <permission-mapping match-all="true">
                        <permission-set name="login-permission"/>
                        <permission-set name="default-permissions"/>
                    </permission-mapping>
                </simple-permission-mapper>
                <constant-realm-mapper name="local" realm-name="local"/>
                <simple-role-decoder name="groups-to-roles" attribute="groups"/>
                <constant-role-mapper name="super-user-mapper">
                    <role name="SuperUser"/>
                </constant-role-mapper>
            </mappers>
            <permission-sets>
                <permission-set name="login-permission">
                    <permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
                </permission-set>
                <permission-set name="default-permissions">
                    <permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission" module="org.wildfly.extension.batch.jberet" target-name="*"/>
                    <permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission" module="org.wildfly.transaction.client"/>
                    <permission class-name="org.jboss.ejb.client.RemoteEJBPermission" module="org.jboss.ejb-client"/>
                </permission-set>
            </permission-sets>
            <http>
                <http-authentication-factory name="management-http-authentication" security-domain="ManagementDomain" http-server-mechanism-factory="global">
                    <mechanism-configuration>
                        <mechanism mechanism-name="DIGEST">
                            <mechanism-realm realm-name="ManagementRealm"/>
                        </mechanism>
                    </mechanism-configuration>
                </http-authentication-factory>
                <provider-http-server-mechanism-factory name="global"/>
            </http>
            <sasl>
                <sasl-authentication-factory name="application-sasl-authentication" sasl-server-factory="configured" security-domain="ApplicationDomain">
                    <mechanism-configuration>
                        <mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
                        <mechanism mechanism-name="DIGEST-MD5">
                            <mechanism-realm realm-name="ApplicationRealm"/>
                        </mechanism>
                    </mechanism-configuration>
                </sasl-authentication-factory>
                <sasl-authentication-factory name="management-sasl-authentication" sasl-server-factory="configured" security-domain="ManagementDomain">
                    <mechanism-configuration>
                        <mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
                        <mechanism mechanism-name="DIGEST-MD5">
                            <mechanism-realm realm-name="ManagementRealm"/>
                        </mechanism>
                    </mechanism-configuration>
                </sasl-authentication-factory>
                <configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
                    <properties>
                        <property name="wildfly.sasl.local-user.default-user" value="$local"/>
                    </properties>
                </configurable-sasl-server-factory>
                <mechanism-provider-filtering-sasl-server-factory name="elytron" sasl-server-factory="global">
                    <filters>
                        <filter provider-name="WildFlyElytron"/>
                    </filters>
                </mechanism-provider-filtering-sasl-server-factory>
                <provider-sasl-server-factory name="global"/>
            </sasl>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:infinispan:8.0">
            <cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">
                <local-cache name="default">
                    <transaction mode="BATCH"/>
                </local-cache>
            </cache-container>
            <cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">
                <local-cache name="passivation">
                    <locking isolation="REPEATABLE_READ"/>
                    <transaction mode="BATCH"/>
                    <file-store passivation="true" purge="false"/>
                </local-cache>
            </cache-container>
            <cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
                <local-cache name="passivation">
                    <locking isolation="REPEATABLE_READ"/>
                    <transaction mode="BATCH"/>
                    <file-store passivation="true" purge="false"/>
                </local-cache>
            </cache-container>
            <cache-container name="hibernate" module="org.infinispan.hibernate-cache">
                <local-cache name="entity">
                    <object-memory size="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <local-cache name="local-query">
                    <object-memory size="10000"/>
                    <expiration max-idle="100000"/>
                </local-cache>
                <local-cache name="timestamps"/>
            </cache-container>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:io:3.0">
            <worker name="default"/>
            <buffer-pool name="default"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
        <subsystem xmlns="urn:jboss:domain:jca:5.0">
            <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
            <bean-validation enabled="true"/>
            <default-workmanager>
                <short-running-threads>
                    <core-threads count="50"/>
                    <queue-length count="50"/>
                    <max-threads count="50"/>
                    <keepalive-time time="10" unit="seconds"/>
                </short-running-threads>
                <long-running-threads>
                    <core-threads count="50"/>
                    <queue-length count="50"/>
                    <max-threads count="50"/>
                    <keepalive-time time="10" unit="seconds"/>
                </long-running-threads>
            </default-workmanager>
            <cached-connection-manager/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
        <subsystem xmlns="urn:jboss:domain:jmx:1.3">
            <expose-resolved-model/>
            <expose-expression-model/>
            <remoting-connector/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jpa:1.1">
            <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:jsf:1.1"/>
        <subsystem xmlns="urn:jboss:domain:mail:3.0">
            <mail-session name="default" jndi-name="java:jboss/mail/Default">
                <smtp-server outbound-socket-binding-ref="mail-smtp"/>
            </mail-session>
        </subsystem>
        <subsystem xmlns="urn:wildfly:microprofile-config-smallrye:1.0"/>
        <subsystem xmlns="urn:wildfly:microprofile-health-smallrye:1.0" security-enabled="false"/>
        <subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:wildfly}"/>
        <subsystem xmlns="urn:wildfly:microprofile-opentracing-smallrye:1.0"/>
        <subsystem xmlns="urn:jboss:domain:naming:2.0">
            <remote-naming/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
        <subsystem xmlns="urn:jboss:domain:remoting:4.0">
            <http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
        <subsystem xmlns="urn:jboss:domain:resource-adapters:5.0"/>
        <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
        <subsystem xmlns="urn:jboss:domain:security:2.0">
            <security-domains>
                <security-domain name="other" cache-type="default">
                    <authentication>
                        <login-module code="Remoting" flag="optional">
                            <module-option name="password-stacking" value="useFirstPass"/>
                        </login-module>
                        <login-module code="RealmDirect" flag="required">
                            <module-option name="password-stacking" value="useFirstPass"/>
                        </login-module>
                    </authentication>
                </security-domain>
                <security-domain name="jboss-web-policy" cache-type="default">
                    <authorization>
                        <policy-module code="Delegating" flag="required"/>
                    </authorization>
                </security-domain>
                <security-domain name="jaspitest" cache-type="default">
                    <authentication-jaspi>
                        <login-module-stack name="dummy">
                            <login-module code="Dummy" flag="optional"/>
                        </login-module-stack>
                        <auth-module code="Dummy"/>
                    </authentication-jaspi>
                </security-domain>
                <security-domain name="jboss-ejb-policy" cache-type="default">
                    <authorization>
                        <policy-module code="Delegating" flag="required"/>
                    </authorization>
                </security-domain>
            </security-domains>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:security-manager:1.0">
            <deployment-permissions>
                <maximum-set>
                    <permission class="java.security.AllPermission"/>
                </maximum-set>
            </deployment-permissions>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:transactions:5.0">
            <core-environment node-identifier="${jboss.tx.node.id:1}">
                <process-id>
                    <uuid/>
                </process-id>
            </core-environment>
            <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
            <coordinator-environment statistics-enabled="${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
            <object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:undertow:8.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <http-invoker security-realm="ApplicationRealm"/>
                </host>
            </server>
            <servlet-container name="default">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
                <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
            </handlers>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:webservices:2.0" statistics-enabled="${wildfly.webservices.statistics-enabled:${wildfly.statistics-enabled:false}}">
            <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
            <endpoint-config name="Standard-Endpoint-Config"/>
            <endpoint-config name="Recording-Endpoint-Config">
                <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
                    <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
                </pre-handler-chain>
            </endpoint-config>
            <client-config name="Standard-Client-Config"/>
        </subsystem>
        <subsystem xmlns="urn:jboss:domain:weld:4.0"/>
		<subsystem xmlns="urn:jboss:domain:mongodb:1.0">
            <mongo name="default" id="mongodb" jndi-name="java:jboss/mongodb/client" database="mongodb" module="org.hibernate.ogm.mongodb">
                <host name="default" outbound-socket-binding-ref="mongodb"/>
                <properties name="default">
                    <property name="writeConcern" value="ACKNOWLEDGED"/>
                    <property name="readConcern" value="LOCAL"/>
                </properties>
            </mongo>
        </subsystem>
    </profile>
    <interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </interface>
    </interfaces>
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>
        </outbound-socket-binding>
        <outbound-socket-binding name="mongodb">
            <remote-destination host="localhost" port="27018"/>
        </outbound-socket-binding>
    </socket-binding-group>
    <deployments>
        <deployment name="mongodb" runtime-name="mongodb-driver-3.10.1.jar">
            <content sha1="0c5d579a134185627f2f6ebc7d8b399e2c59aa4f"/>
        </deployment>
    </deployments>
</server>

Do I need to configure the properties the programmatic way? I thought inserting them directly into the standalone.xml would be sufficient.

I think something is wrong with the feature packs you are using, you are probably missing this one:

<feature-pack groupId="org.wildfly.nosql" artifactId="wildfly-mongodb-feature-pack" version="${version.wildfly.nosql}" />

That’s why the server does not recognize mongodb as a subsystem.
I would recommend to use the maven provisioning plugin for the creation of the wildfly you need.

Like we do in the OGM project: https://github.com/hibernate/hibernate-ogm/blob/master/integrationtest/pom.xml#L83

This is the server provisioning file we use: https://github.com/hibernate/hibernate-ogm/blob/master/integrationtest/server-provisioning.xml

but you can remove the hibernate-ogm-* of the datastores you don’t need.

I’m sorry for that late answer :sweat_smile:

I’ve spent the last few days rewriting the project so that Maven automatically downloads and sets up WildFly like in the integrationtest. Only adding the wildfly-mongodb-feature-pack feature pack didn’t help me fix the problem.
I had to work my way through the many files in the main Hibernate project, so I didn’t come to answer.

Finally I got to the point that the MongoDB subsystem is now loaded and the server starts without errors.

But I am not finished yet, because the properties of the external mongodb instance are not loaded yet.

Nevertheless I think that my original question of this forum post is now answered and other questions wouldn’t belong here anymore.

Finally, I think the problem was not to let Maven build the server, but to provide it manually.

I’m glad you solved that issue.

But I am not finished yet, because the properties of the external mongodb instance are not loaded yet.

If you are using the mongodb created by the WildFly subsystem, you have to declare the properties in the subsystem configuration. For example:

        <subsystem xmlns="urn:jboss:domain:mongodb:1.0">
            <mongo name="default" id="mongodb" jndi-name="java:jboss/mongodb/client" database="mongodb" module="org.hibernate.ogm.mongodb">
                <host name="default" outbound-socket-binding-ref="mongodb"/>
                <properties name="default">
                    <property name="writeConcern" value="ACKNOWLEDGED"/>
                    <property name="readConcern" value="LOCAL"/>
                </properties>
            </mongo>
        </subsystem>

I’m not sure which properties are supported, but
when you set the property hibernate.connection.resource in your app, OGM takes the client in the JNDI environment and use it as is.

Don’t hesitate to ask if you have more questions.

Cheers

The supported properties can be found in the wildfly-nosql GitHub project.

When I first read the Hibernate documentation, I thought that all properties should be entered under <properties name="default"> ... </properties> like in the persistence.xml, but this is not the case.

An example client can be found in the README: https://github.com/wildfly/wildfly-nosql/blob/master/doc/README.adoc#connecting-to-mongodb-from-wildfly

All supported properties are listed in this schema: https://github.com/wildfly/wildfly-nosql/blob/master/mongodb/subsystem/src/main/resources/schema/wildfly-mongodb_1_0.xsd
With the help of this scheme I tried to connect an external MongoDB cluster, including a user profile, and it worked without problems.

To clarify for future readers:

The properties described in the Hibernate OGM documentaiton can be set in multiple places because they refer to the client created by OGM. That mongo client is not supposed to be used outside the scope of OGM.

If the client is created outside the scope of OGM (like in this case), HIbernate OGM takes it from the JNDI environment as it is.

In extreme cases, it is also possible to extend the class MongoDBDatastoreProvider and overrides the method createMongoClient to return a custom created client.

Cheers

1 Like