0

pom.xml

<dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-mongodb</artifactId>
            <version>5.4.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.2.Final</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.3.14.Final</version>
        </dependency>

persistence.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0">
    <persistence-unit name="ogm-jpa"
        transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
       <class>com.iexceed.mongopoc.entity.Breed</class>
<properties>
            <property name="hibernate.ogm.datastore.provider"
                value="mongodb" />
            <property name="hibernate.ogm.datastore.host"
                value="host" />
            <property name="hibernate.ogm.datastore.username"
                value="USERNAME" />
            <property name="hibernate.ogm.datastore.password"
                value="PASSWORD" />
            <property name="hibernate.ogm.datastore.database"
                value="admin" />
                <property name="hibernate.ogm.datastore.port" value="27017"/>
        </properties>
</persistence-unit>
</persistence>

I am getting the following error RuntimeException javax.persistence.PersistenceException: No Persistence provider for EntityManager named ogm-jpa

Saisha
  • 21
  • 4
  • Have you already tried to import the bom and use the version of ogm-mongodb defined in there like in the official documentation? (https://hibernate.org/ogm/documentation/getting-started/) – Nico Feb 19 '20 at 14:09
  • Can you add your project structure along with all the declared configuration files? – tmarwen Feb 19 '20 at 14:14
  • same is working with tomcat8.5 – Saisha Feb 20 '20 at 04:36
  • i already imported the bom and i m using the version of ogm-mongodb defined in the hibernate ogm official doucmentation – Saisha Feb 20 '20 at 04:53
  • This error is a bit vague. It could be any sort of things. Would you be able to provide an example of the archive you are deploying somewhere? Thanks – Davide D'Alto Feb 20 '20 at 09:57
  • I removed the jpa subsystem from Standalone.xml file, just started working. Thank you everyone for your suggestions and comments – Saisha Feb 21 '20 at 14:11

1 Answers1

0

Blockquote

Removed the following subsystem from the jboss standalone.xml file

<subsystem xmlns="urn:jboss:domain:jpa:1.1">
            <jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
</subsystem> 
Saisha
  • 21
  • 4