4 Replies Latest reply on May 28, 2016 4:43 PM by wdfink

    Lucene Directory Cache with FileStore

    teacurran

      I have the following configuration which is working in WildFly 8 with Hibernate Search:

      <cache-container name="hibernateSearch" default-cache="LuceneIndexesData">
          <transport lock-timeout="330000"/>
          <replicated-cache name="LuceneIndexesMetadata" mode="SYNC" remote-timeout="330000">
              <locking striping="false" acquire-timeout="330000" concurrency-level="500"/>
              <transaction mode="NONE"/>
              <eviction strategy="NONE" max-entries="-1"/>
              <expiration max-idle="-1"/>
              <state-transfer enabled="true" timeout="480000"/>
              <file-store preload="true" purge="false" passivation="false" relative-to="jboss.home.dir"
                          path="standalone/data/infinispan-file-store">
                  <write-behind/>
              </file-store>
              <indexing index="NONE"/>
          </replicated-cache>
          <replicated-cache name="LuceneIndexesData" mode="SYNC" remote-timeout="25000">
              <locking striping="false" acquire-timeout="330000" concurrency-level="500"/>
              <transaction mode="NONE"/>
              <eviction strategy="NONE" max-entries="-1"/>
              <expiration max-idle="-1"/>
              <state-transfer enabled="true" timeout="480000"/>
              <file-store preload="true" purge="false" passivation="false" relative-to="jboss.home.dir"
                          path="standalone/data/infinispan-file-store">
                  <write-behind/>
              </file-store>
              <indexing index="NONE"/>
          </replicated-cache>
          <replicated-cache name="LuceneIndexesLocking" mode="SYNC" remote-timeout="25000">
              <locking striping="false" acquire-timeout="330000" concurrency-level="500"/>
              <transaction mode="NONE"/>
              <eviction strategy="NONE" max-entries="-1"/>
              <expiration max-idle="-1"/>
              <state-transfer enabled="true" timeout="480000"/>
              <indexing index="NONE"/>
          </replicated-cache>
      </cache-container>
      

       

      When if I try to run this same configuration on WildFly 9 it gives the following exception:

      20:57:31,021 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 23) MSC000001: Failed to start service jboss.persistenceunit."application-1.0-SNAPSHOT-exploded.war#searchexperiment": org.jboss.msc.service.StartException in service jboss.persistenceunit."application-1.0-SNAPSHOT-exploded.war#searchexperiment": org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'com.wirelust.experiment.hibernatesearch.model.City'
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
        at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:665)
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'com.wirelust.experiment.hibernatesearch.model.City'
        at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:260)
        at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:513)
        at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManagers(IndexManagerHolder.java:482)
        at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:91)
        at org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchIntegratorBuilder.java:358)
        at org.hibernate.search.spi.SearchIntegratorBuilder.buildNewSearchFactory(SearchIntegratorBuilder.java:199)
        at org.hibernate.search.spi.SearchIntegratorBuilder.buildSearchIntegrator(SearchIntegratorBuilder.java:117)
        at org.hibernate.search.hcore.impl.HibernateSearchSessionFactoryObserver.sessionFactoryCreated(HibernateSearchSessionFactoryObserver.java:66)
        at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:52)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:588)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
        at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849)
        at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
        ... 7 more
      Caused by: org.infinispan.commons.marshall.NotSerializableException: Object of type class org.infinispan.lucene.FileListCacheKey expected to be marshallable
      

       

      This error only happens when using file-store.

       

      Is this not supported for Lucene File System anymore?

      Or is is there something specific I have to do to configure it?

      Is this a question for the Hibernate Search team and not the Infinispan team?

        • 1. Re: Lucene Directory Cache with FileStore
          wdfink

          Do you use the Infinispan bits provided by WildFly modules?

          This might have issues as the Infinispan subsystem is not meant to work for application caches, the subsystem/module is stripped for internal use only.

          This might be the cause.

           

          Could you add the Infinispan bits and use is, see infinispan.org (WildFly modules)

          • 2. Re: Lucene Directory Cache with FileStore
            teacurran

            Thanks for your help.

            That's too bad that embedded Infinspan isn't supported for applications. Using the embedded subsystem is one of the things that makes our DevOps work a lot easier.

             

            With that said, I can confirm that if I install the latest 7.2 modules into WF9 I can get it working properly.

            Thanks again

            • 3. Re: Lucene Directory Cache with FileStore
              tka001

              We are trying to get this setup to work in a clustered environment with Wildfly 9. Upgrading the Infinispan modules leads to this exception during deployment:

               

              java.lang.ClassCastException: org.jboss.as.clustering.infinispan.DefaultCacheContainer cannot be cast to org.infinispan.manager.EmbeddedCacheManager
              

               

              Anybody got an idea what's going wrong here?

              • 4. Re: Lucene Directory Cache with FileStore
                wdfink

                Hi Tom,

                 

                I would recommend to open a new thread and attach the full configuration and more information