5 Replies Latest reply on Jun 11, 2010 6:39 AM by galder.zamarreno

    Infinispan on JBoss AS 5.1.0.GA


      Hi there,


      I was trying to get infinispan running on my JBoss AS 5.1.0.GA today. As I didn't find information on how to integrate infinispan into my existing application using the hibernate lvl2 cache with infinispan, I just added the maven dependency to the projects pom. It downloaded and built successfully, but as soon as I deploy it on the AS i get the following Exception:


      java.lang.ClassNotFoundException: org.hibernate.cache.infinispan.InfinispanRegionFactory


      Now I wondered if I need to use hibernate 3.5 and acording to this version the jboss 6.x? Or is it also possible to use infinispan with the older hibernate version with all the configs for using it as 2nd lvl cache as I just used jboss cache 3 before?


      Would maybe usefull to have at least some statement about these requirements at FAQs or somewhere else




        • 1. Re: Infinispan on JBoss AS 5.1.0.GA

          Hi Felix,


          Not 100% sure so I am going to leave it to Galder to provide a definete response to you.  Until then, have a look at http://community.jboss.org/wiki/usinginfinispanasjpahibernatesecondlevelcacheprovider


          And, just in case you are not aware of http://community.jboss.org/wiki/infinispan


          All the best,


          • 2. Re: Infinispan on JBoss AS 5.1.0.GA

            Hey Vladimir,


            thanks for the hint, but yes of course I know about the article and about the wiki. I have been looking around there, but not even the FAQ gives information about the version dependecies and if there is any way to get infinispan running on the older jboss as.


            As far as I could proove it myself, I was looking for the missing class and it can be found at the new hibernate library, but not at the older one. There are some hints at the wiki that could tell you, that you need the newer version. But I think it's not that straight as it could be


            Best Regards,


            • 3. Re: Infinispan on JBoss AS 5.1.0.GA

              HI Felix,


              The reason you're encountering the  ClassNotFoundException is simple, you're missing the corresponding hibernate-infinispan-*.jar containing the 2LC code that works with Infinispan. You can download it from https://repository.jboss.org/nexus/content/groups/developer/org/hibernate/hibernate-infinispan


              Now, Infinispan 2LC is only available since Hibernate 3.5 and this version has so far only been integrated with AS 6. So, you're best bet to get it working is to use AS 6.


              In theory, you should be able to get Hibernate 3.5 and Infinispan working in AS 5 by deploying them in an isolated ear or similar, making sure you include the newer JGroups jar as well. However, I know someone that had tried it and at least for JPA applications, there was a classloading issue with the way JPA interfaces were being loaded. If you're not using JPA and use instead Hibernate directly, it might work, but again, this is untested area.


              I'll add a clearer message to the wiki wrt to this topic.

              • 4. Re: Infinispan on JBoss AS 5.1.0.GA

                Hey Galder,


                thanks for the response, that prooved my assumption


                At least good to know it's not a local problem of my deployment. And I'd really like to try this with the JBoss AS 6, but some parts of the app stick with the old messaging core of the as 5, maybe I'll try that later when the as 6 is stable.


                I also tried to deploy the newer hibernate version to the older as, but I had the same the class loading problems you mentioned. Would be great, if you could discribe or even post a link one the information where it is discribed who to get the deployment working. As I am heavily using JPA I won't try to get this done right now, maybe future versions of the 5.x work with some hibernate 3.5+.


                All the best,


                • 5. Re: Infinispan on JBoss AS 5.1.0.GA