4 Replies Latest reply on May 20, 2014 8:58 AM by samppaa

    Using infinispan query on wildfly

    samppaa

      Hi,

       

      I'm trying to use Infinispan query and querydsl on Wildfly 8.1.CR1 but when I try to create a search manager i get the following exception:

      java.lang.IllegalArgumentException: Indexing was not enabled on this cache. interface org.hibernate.search.spi.SearchFactoryIntegrator not found in registry
          at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:27) [infinispan-query-6.0.2.Final.jar:6.0.2.Final]
          at org.infinispan.query.impl.ComponentRegistryUtils.getComponent(ComponentRegistryUtils.java:20) [infinispan-query-6.0.2.Final.jar:6.0.2.Final]
          at org.infinispan.query.impl.SearchManagerImpl.<init>(SearchManagerImpl.java:42) [infinispan-query-6.0.2.Final.jar:6.0.2.Final]
          at org.infinispan.query.Search.getSearchManager(Search.java:17) [infinispan-query-6.0.2.Final.jar:6.0.2.Final]
          at com.test.client.DummyService.search(DummyService.java:92) [classes:]
      
      

       

      the code that throws the exception is line 2 bellow:

      log.info("indexing enabled={}", cache.getCacheConfiguration().indexing().enabled());
      SearchManager sm = Search.getSearchManager(cache);
      
      

       

      And what is also curious is that in server log says "indexing enabled=true"

       

      the cache container in standalone.xml is as follows:

      <subsystem xmlns="urn:jboss:domain:infinispan:2.0">
                  <cache-container name="test" default-cache="default">
                      <transport lock-timeout="60000"/>
                      <local-cache name="default" batching="true">
                          <transaction mode="NONE"/>
                          <indexing index="LOCAL"/>
                      </local-cache>
                  </cache-container>
      
      

       

      I have also tried with index="ALL" with the same result.

       

      My module dependencies are specified as follows:

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
          <deployment>
              <dependencies>
                  <module name="org.infinispan" export="true"/>
                  <module name="org.infinispan.client.hotrod" export="true"/>
                  <module name="org.infinispan.query" export="true"/>
                  <module name="org.infinispan.query.dsl" export="true" />
                  <module name="org.hibernate.search.engine" export="true"/>
              </dependencies>
          </deployment>
      
      </jboss-deployment-structure>
      
      

       

       

      Could some help me out here?

       

      Br,

      Samuli

        • 1. Re: Using infinispan query on wildfly
          pferraro

          You need to specify the module with which to initialize Infinispan's cache manager's modules.

          e.g.

           

          <cache-container name="test" default-cache="default" module="org.infinispan.query">
               <!-- ... -->
          </cache-container>
          

           

          This tells Infinispan to load all modules visible from the "org.infinispan.query" module.

          1 of 1 people found this helpful
          • 2. Re: Using infinispan query on wildfly
            samppaa

            Thanks,

             

            I also found this [1] thread that discusses the same problem on AS7 that I thinks applies here as well. Specifying the module alone wasn't enough to make the query functionality to work though. I'll post my findings here when I get the time to investigate this further.

             

            [1] Infinispan Queries in AS7

            • 3. Re: Using infinispan query on wildfly
              ctomc

              Just line of note here,

              WildFly 8 ships with lots of extra ispn modules such as query where AS7 had none.

              So what worked in AS7 might not necessarily work in WildFly8

              • 4. Re: Using infinispan query on wildfly
                samppaa

                I'm aware of that and that's why I tried if it would work with just using the module="org.infinispan.query" on the cache but that was not the case. So the correct answer is probably some kind of modification of the instructions for AS7