-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
 Post subject: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Fri Jul 22, 2016 4:30 am 
Newbie

Joined: Tue Oct 15, 2013 12:16 pm
Posts: 10
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-example

Thanks!

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>


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Fri Jul 22, 2016 1:32 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Thanks for letting us know.
I'm checking.

Davide


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Sat Jul 23, 2016 1:53 am 
Newbie

Joined: Tue Oct 15, 2013 12:16 pm
Posts: 10
Thanks Davide

The stacktrace from the server startup might give a little more insight

Code:
Caused by: org.hibernate.search.exception.SearchException: Wrong configuration of directory provider: class org.infinispan.hibernate.search.spi.InfinispanDirectoryProvider does not implement interface
        at org.hibernate.search.util.impl.ClassLoaderHelper.verifySuperTypeCompatibility(ClassLoaderHelper.java:113)
        at org.hibernate.search.util.impl.ClassLoaderHelper.instanceFromClass(ClassLoaderHelper.java:93)
        at org.hibernate.search.util.impl.ClassLoaderHelper.instanceFromName(ClassLoaderHelper.java:58)
        at org.hibernate.search.store.spi.BaseDirectoryProviderService.initialize(BaseDirectoryProviderService.java:57)
        at org.hibernate.search.store.spi.BaseDirectoryProviderService.create(BaseDirectoryProviderService.java:52)
        at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.createDirectoryProvider(DirectoryBasedIndexManager.java:230)
        at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:90)
        at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:256)
        ... 21 more


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Sat Jul 23, 2016 5:15 am 
Newbie

Joined: Tue Oct 15, 2013 12:16 pm
Posts: 10
It turn out the specific problem is related to

Code:
<property name="hibernate.search.default.directory_provider" value="infinispan"/>

and if I replace it with ram it works.

It's not clear to me how I can use infinispan as directory provider with Hibernate Search and OGM with the latest version, but I suspect this might be a class loader issue?


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Mon Jul 25, 2016 6:01 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Yes, I think it's caused by the classloader isolation in WildFly.
I haven't found a solution yet but thanks to you I've now realised that we don't have a testcase for that specific scenario (shame on us).

Just to clarify, Was this working with a previous version of OGM?

Thanks,
Davide


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Mon Jul 25, 2016 7:00 am 
Newbie

Joined: Tue Oct 15, 2013 12:16 pm
Posts: 10
Yes it did. My original example was working with :

    Hibernate OGM 4.1.3.Final
    Infinispan 7.1.1.Final
    Wildfly 8.2.0.Final

The major different from the original example, it included it's own Hibernate Search module, and that is now distributed with Wildfly 10.

I'm also trying to find a solution.

Thanks for looking into this,
Flemming


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Mon Jul 25, 2016 6:04 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
I think I found the problem, you need to use
Code:
org.infinispan.hibernate-search.directory-provider:for-hibernatesearch-5.5 services

instead of 5.6

But you need to add the module because is not in WildFly 10 by default.
You can download the required modules on the infinispan website:
http://downloads.jboss.org/infinispan/8 ... .Final.zip

Hope this help,
Davide


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Tue Jul 26, 2016 4:23 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Actually, once you installed the module, you can remove this line from the MANIFEST:
Code:
org.infinispan.hibernate-search.directory-provider:for-hibernatesearch-5.5 services


The fact is that this module is optional and it get used if you need to use it but you need to install it if you need it.

Hope this help,
Davide


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Wed Jul 27, 2016 3:00 am 
Newbie

Joined: Tue Oct 15, 2013 12:16 pm
Posts: 10
Thanks Davide for looking into this. It's working after I downloaded the correct version of the embedded module

You need to take a look on the documentation becaus it's linking to version "8.2.1.Final" and it should be "8.2.3.Final" as you wrote

http://docs.jboss.org/hibernate/ogm/5.0/reference/en-US/html_single/#using_the_hibernate_ogm_modules_with_infinispan


Top
 Profile  
 
 Post subject: Re: Problem with upgrading to Wildfly 10 & Hibernate OGM 5
PostPosted: Wed Jul 27, 2016 4:52 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Thanks for letting me know, I will update the documentation


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.