Folks,
I’m upgrading my Hibernate OGM example to the latest and greatest, but I’m running into an issue which I haven’t find any solution for.
You can find the complete code on github
https://github.com/fharms/java-examples/tree/upgrade_ogm_wildfly10/hibernate-ogm-infinispan7-jpa-exampleThanks!
Code:
Caused by: java.lang.Exception: {"WFLYCTL0080: Failed services" => {
"jboss.persistenceunit.\"9ea810d9-06e2-4f73-b533-b13234ce1fa3.war#RemoteEventQueue\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"9ea810d9-06e2-4f73-b533-b13234ce1fa3.war#RemoteEventQueue\": javax.persistence.PersistenceException: [PersistenceUnit: RemoteEventQueue] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: RemoteEventQueue] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'com.fharms.ogm.infinispan7.jpa.example.model.Subscriber'
Caused by: org.hibernate.search.exception.SearchException: Wrong configuration of directory provider: class org.infinispan.hibernate.search.spi.InfinispanDirectoryProvider does not implement interface org.hibernate.search.store.DirectoryProvider",
"jboss.persistenceunit.\"9ea810d9-06e2-4f73-b533-b13234ce1fa3.war#RemoteEventQueueSQL\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"9ea810d9-06e2-4f73-b533-b13234ce1fa3.war#RemoteEventQueueSQL\": javax.persistence.PersistenceException: [PersistenceUnit: RemoteEventQueueSQL] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: RemoteEventQueueSQL] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'com.fharms.ogm.infinispan7.jpa.example.model.Subscriber'
Caused by: org.hibernate.search.exception.SearchException: Wrong configuration of directory provider: class org.infinispan.hibernate.search.spi.InfinispanDirectoryProvider does not implement interface org.hibernate.search.store.DirectoryProvider"
}}
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getActionResult(ServerDeploymentPlanResultFuture.java:134)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.getResultFromNode(ServerDeploymentPlanResultFuture.java:123)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:85)
at org.jboss.as.controller.client.helpers.standalone.impl.ServerDeploymentPlanResultFuture.get(ServerDeploymentPlanResultFuture.java:42)
at org.jboss.as.controller.client.helpers.standalone.ServerDeploymentHelper.deploy(ServerDeploymentHelper.java:55)
at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:77)
at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:64)
at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:46)
persistence.xml
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="RemoteEventQueue" transaction-type="JTA">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<!-- When using HibernateOgmPersistence provider it does not scan for entity classes -->
<class>com.fharms.ogm.infinispan7.jpa.example.model.RemoteEvent</class>
<class>com.fharms.ogm.infinispan7.jpa.example.model.Subscriber</class>
<class>com.fharms.ogm.infinispan7.jpa.example.model.EventVO</class>
<properties>
<!-- Changing from filebase to Infinispan gave huge performance from 3 sec to 177 ms -->
<property name="hibernate.search.default.directory_provider" value="infinispan"/>
<property name="hibernate.search.default.exclusive_index_use" value="false"/>
<property name="hibernate.ogm.datastore.provider"
value="infinispan" />
<property name="jboss.as.jpa.providerModule" value="application" />
<property name="hibernate.ogm.infinispan.configuration_resource_name" value="com/fharms/ogm/infinispan7/jpa/example/dao/infinispan-local.xml"/>
</properties>
</persistence-unit>
<!-- If you want to run with Hibernate ORM and SQL database, change the persistence unitname
in the class com.fharms.ogm.infinispan7.jpa.example.dao.RemoteEventDao
-->
<persistence-unit name="RemoteEventQueueSQL" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create" />
<!-- Changing from filebase to Infinispan gave huge performance from 3 sec to 177 ms -->
<property name="hibernate.search.default.directory_provider" value="infinispan"/>
<property name="hibernate.search.default.exclusive_index_use" value="false"/>
</properties>
</persistence-unit>
</persistence>