hibernate search, infinispan, jgroups, wildfly 10
turchinc Aug 5, 2016 12:22 PMI am trying to get hibernate-search running with infinispan and jgroups on wildfly 10 (was running with wildfly 8.2.1 but we want to update to the lucene version offered with wildfly 10).
We already use infinispan as a 2nd level cache in our config.
When I configure hibernate search to use "ram" instead of "infinispan" it also works:
<property name="hibernate.search.default.directory_provider" value="ram"/>
In an attempt to fix this, and since I saw that infinispan-directory-provider.jar is no longer distributed with hibernate-search in Wildfly, I downloaded the infinispan modules from
http://downloads.jboss.org/infinispan/8.2.3.Final/infinispan-as-embedded-modules-8.2.3.Final.zip
(this was mentioned in the link referenced below) and extracted them to <WFLY>/modules.
I then adjusted my jboss-deployment-structure.xml to include:
<!-- hibernate search services -->
<module name="org.infinispan" />
<module name="org.hibernate.search.engine" services="export" slot="5.6" />
<module name="org.hibernate.search.orm" services="export" slot="5.6" />
The modified configuration gets picked up:
15:46:33,568 INFO [org.hibernate.search.engine.Version] (ServerService Thread Pool -- 81) HSEARCH000034: Hibernate Search 5.6.0.Beta1
But I now get (I was getting ClassNotFoundException for the InfinispanDirectoryProvider):
15:46:37,098 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 81) MSC000001: Failed to start service jboss.persistenceunit."mc.ear/web.war#mc": org.jboss.msc.service.StartException in service jboss.persistenceunit."mc.ear/web.war#mc": javax.persistence.PersistenceException: [PersistenceUnit: mc] Unable to build Hibernate SessionFactory
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mc] Unable to build Hibernate SessionFactory
Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'Node'
Caused by: org.hibernate.search.exception.SearchException: HSEARCH000252: Unable to initialize directory provider org.infinispan.hibernate.search.spi.InfinispanDirectoryProvider for index Node
Caused by: java.lang.ClassCastException: org.jboss.as.clustering.infinispan.DefaultCacheContainer cannot be cast to org.infinispan.manager.EmbeddedCacheManager
at org.infinispan.hibernate.search.impl.DefaultCacheManagerService.locateCacheManager(DefaultCacheManagerService.java:98)
at org.infinispan.hibernate.search.impl.DefaultCacheManagerService.start(DefaultCacheManagerService.java:89)
at org.hibernate.search.engine.service.impl.StandardServiceManager$ServiceWrapper.startService(StandardServiceManager.java:257)
at org.hibernate.search.engine.service.impl.StandardServiceManager$ServiceWrapper.startVirtual(StandardServiceManager.java:209)
at org.hibernate.search.engine.service.impl.StandardServiceManager.requestService(StandardServiceManager.java:83)
at org.infinispan.hibernate.search.spi.InfinispanDirectoryProvider.initialize(InfinispanDirectoryProvider.java:66)
at org.hibernate.search.store.spi.BaseDirectoryProviderService.initialize(BaseDirectoryProviderService.java:64)
... 24 more
I read here:
Hibernate Community • View topic - Problem with upgrading to Wildfly 10 & Hibernate OGM 5
That I should use
org.infinispan.hibernate-search.directory-provider:for-hibernatesearch-5.5 services
In my manifest instead of using the slot="5.6" but I am not sure how to translate that into jboss-deployment-structure.xml configuration?
I also tried doing all of this with Wildfly-10.1.0.CR1 (thinking because it includes infinispan 8.2.3 maybe it will work better) and get just as far until I get this exception.
Does anyone have advice? Thanks!
Similar issues:
Lucene Directory Cache with FileStore
ClassCastException in EAP 6.4 when using HibernateSearch and infinispan lucene directory