5 Replies Latest reply on Jul 25, 2014 4:54 AM by wdfink

    Where is Infinispan-query in EAP 6.2??


      Until recently, I've been using an Inifinspan cache and was searching it using Infinispan's query capabilities.  I was initializing my cache in code rather than using XMl configuration via domain.xml.  My app was pulling in its own infinispan jarfiles, which I realized was a problem.  I've recently upgraded to EAP 6.2 and decided to fix the app by using xml configuration, using injection to find my cache, and use the jarfiles that come with the JBoss distribution.  However, I've discovered that the jar file(s) required for Infinispan's query to work do not appear to be included in the JBoss distribution.  The jar file I was using that had the classes was infnispan-query-5.2.7.Final.jar and, sticking with the naming conventions in the JBoss distribution, would've expected to find infinispan-query-5.2.7.Final-redhat-2.jar but it's nowhere to be found. 


      Can someone tell me where it is or if there is some other way to get access to Infinispan's search capabilities?  I have tried playing with my maven build by including only the infnispan-query-5.2.7.Final.jar it has dependencies get pulled into my ear file that conflict with those in the JBoss distriution.



        • 1. Re: Where is Infinispan-query in EAP 6.2??

          The Infinispan modules provided by EAP distribution are only for internal use (session replication, cluster and other internal caches), therefore there is no infinispan-query available.

          You need to pack the relevant Infinispan/JDG libraries with your application.

          A simple way to achive it is to use JDG 6.3 which provide modules for EAP, you only need to add a dependency but not pack the bits into the application.


          Also notice that this require an additional JDG supbsription if you use EAP/JDG in production.

          1 of 1 people found this helpful
          • 2. Re: Where is Infinispan-query in EAP 6.2??

            Thanks for the reply Wolf.


            Assuming I bundle my own copies of the Infinispan jars, does this mean I have to stick with configuring my cache in code rather than XML (via domain.xml)?

            • 3. Re: Where is Infinispan-query in EAP 6.2??

              If you try to use application caches together with the supported EAP version?

              In short : YES


              You need to use the library mode, which mean you pack JDG/Infinispan with your app and configure it here via xml descriptor inside the application or programatic.

              The standalone/domain.xml use the EAP bundled infinispan and this in only for internal use.

              Technically it is possible but it is not supported to use application drive caches or change the Infinispan modules in EAP

              • 4. Re: Where is Infinispan-query in EAP 6.2??

                Thanks again Wolf,


                I have used library mode and bundled the Infinispan jarfiles in my app (ear file) but when I try to deploy I get the exception:


                Caused by: java.lang.ClassCastException: Cannot cast org.infinispan.query.impl.LifecycleManager to org.infinispan.lifecycle.ModuleLifecycle

                     at java.lang.Class.cast(Class.java:3005) [rt.jar:1.7.0_06]

                     at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:362) [rt.jar:1.7.0_06]


                (This is a much condensed version of the stack trace. I can provide more if you like)


                The problem seems to be a conflict between the two versions of the infinispan-core jarfiles.  I traced through the code and found that it's trying to cast the LifecycleManager class to ModuleLifecycle interface, which should work because LifecycleManager implements ModuleLifecycle.  However, the problem is that  LifecycleManager comes from my own infinispan-core-5.2.7.Final.jar (in my ear/lib directory) and the ModuleLifecycle interface is coming from infinispan-core-5.2.7.Final-redhat-2.jar in the JBoss distribution.  If I remove the infinispan-core-5.2.7.Final.jar from my ear, the app deploys fine.


                Is there a way to fix this?  That is, how can I tell jboss to use the infinispan-core-5.2.7.Final.jar from my ear or do I have to build my earfile and make sure I don't pull in infinispan-core-5.2.7.Final.jar?  (I'm asking because I don't know how to go about doing this with maven but will figure it out if there's no other way)

                • 5. Re: Where is Infinispan-query in EAP 6.2??

                  You might use the JDG6.3 EAP-modules and the jboss-deployment-structure.xml in your application. See jboss-jdg-quickstarts/eap-cluster-app