I'm configuring Hibernate Search 5.5.5 to use Infinispan 8.2.2 on Wildfly 10. I configured only the Infinispan module in Wildfly, not the Hibernate Search module.
Inside the persistence.xml I put this configuration:
<property name="hibernate.search.infinispan.cachemanager_jndiname" value="java:jboss/infinispan/container/hibernateSearch" />
<property name="wildfly.jpa.hibernate.search.module" value="none" />
This because seems that Infinispan is used, but doesn't persist the index.
All caches are configured in domain.xml as below:
<cache-container name="hibernateSearch" default-cache="LuceneIndexesData" jndi-name="java:jboss/infinispan/hibernateSearch" statistics-enabled="false">
<replicated-cache name="LuceneIndexesMetadata" mode="ASYNC">
<file-store fetch-state="false" passivation="false" preload="false" purge="false" shared="false" singleton="false"/>
</replicated-cache>
<replicated-cache name="LuceneIndexesLocking" mode="SYNC">
<file-store fetch-state="false" passivation="false" preload="false" purge="false" shared="false" singleton="false"/>
</replicated-cache>
<replicated-cache name="LuceneIndexesData" mode="ASYNC">
<file-store fetch-state="false" passivation="false" preload="false" purge="false" shared="false" singleton="false"/>
</replicated-cache>
</cache-container>
in jboss-deployment-structure.xml:
<module name="org.infinispan" slot="ispn-8.2"/>
<module name="org.hibernate.search.orm" services="export" />
When I try to index all I receive this error:
UNHANDLED_EXCEPTION: java.lang.IllegalArgumentException: java.lang.Object is not an indexed entity or a subclass of an indexed entity
But If I remove this line:
<property name="wildfly.jpa.hibernate.search.module" value="none" />
I got
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
The problem seems the same described here:
https://developer.jboss.org/thread/271789
But I don't find any working solution, and I'm sure that I havent one or more Infinispan or Hibernate version in my classpath.
What is wrong? :(
TLDR; You are having 2 Infinispan versions in your classpath: one in your
jboss-deployment-structure.xml
and one coming withorg.jboss.as.clustering
subsystem.
<property name="wildfly.jpa.hibernate.search.module" value="none" />
just means do not automatically use AND export app server "search" module for my app.
Thus, <module name="org.hibernate.search.orm" services="export" />
is redundant, it will be done automatically as soon as you put the correct module id for wildfly.jpa.hibernate.search.module
instead of none
or just remove the property to use the default search module.
The none
option is there for situations, when you don't want to use the default or custom search module but bundle it within your app.
More details WildFly 10 Docs - Using Hibernate Search
<module name="org.infinispan" slot="ispn-8.2"/>
doesn't upgrade WildFly Infinispan subsystem. It only allows your app to directly use Infinispan as a library. The correct way would be one of:
org.jboss.as.clustering.infinispan
module to use custom Infinispan versionIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With