I am trying to use JPA OGM with MongoDB.
I have added the latest version of Hibernate (5.3.0.CR1) to the WildFly 11 module folder:
/usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/hibernate/5.3.0.CR1
I have added the Hibernate version to my persistence.xml
<persistence-unit name="NOTiFYwellMongoDBPersistenceUnit" transaction-type="JTA">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<property name="jboss.as.jpa.providerModule" value="org.hibernate:5.3.0.CR1"/>
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAS"/>
<property name="hibernate.ogm.datastore.provider" value="org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider"/>
<property name="hibernate.ogm.datastore.grid_dialect" value="org.hibernate.ogm.datastore.mongodb.MongoDBDialect"/>
<property name="hibernate.ogm.datastore.database" value="notifyWellDB"/>
<property name="hibernate.ogm.mongodb.host" value="127.0.0.1"/>
</properties>
</persistence-unit>
When I build the EAR and have to keep adding various JARs from Hibernate and OGM to get rid the 'class not found exceptions'.
I'm now stuck with:
ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 65) MSC000001: Failed to start service jboss.persistenceunit."NOTiFYwell.ear/NOTiFYwellJAR.jar#NOTiFYwellMongoDBPersistenceUnit": org.jboss.msc.service.StartException in service jboss.persistenceunit."NOTiFYwell.ear/NOTiFYwellJAR.jar#NOTiFYwellMongoDBPersistenceUnit": java.util.ServiceConfigurationError: org.hibernate.boot.model.TypeContributor: Provider org.hibernate.type.Java8DateTimeTypeContributor not a subtype
Why aren't the required JARs being picked up from the modules folders and automatically loaded by the 'class loader' instead of having to manually add them to an EAR?
Please extract this and put it in ${wildflyHome}/modules.
Then put following tag in your pom.xml: