This document is DEPRECATED.

Please consider any information here as out of date. DO NOT use this document.

Instead, refer to

Please update your bookmarks accordingly.

Skip to end of metadata
Go to start of metadata

A JBoss AS 5.x application can be configured to use Infinispan 4.x as the Hibernate 2nd-level cache, replacing JBoss Cache.

  1. Add the attached jar files to the ear lib directory. These include the core 4.1.0.GA Infinispan jar (infinispan-core.jar), the Hibernate/Infinispan integration jar back-ported from Hibernate 3.5 (hibernate-infinispan-3.3.2.GA_CP03.jar), the JGroups jar required by Infinispan 4.1.0 (jgroups-2.10.0.GA.jar), and other required 3rd party jars (river-1.2.3.GA.jar, marshalling-api-1.2.3.GA.jar)
  2. Isolate the classloading to be ear-scoped by adding META-INF/jboss-classloading.xml
  3. Configure persistence.xml to use Infinispan instead of JBoss Cache:
infinispan infinispan Delete
hibernate hibernate Delete
jbossas jbossas Delete
jboss_cache jboss_cache Delete
as5 as5 Delete
2lcache 2lcache Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 06, 2012

    You can deploy infinispan 5.x as your overall cacheprovider on jboss5 by scoping your classloader to load the jars inside your ear first like this:


    If you build with maven-ear-plugin you also add this in your pom.xml:

    Just doing this will fail to start due to NoSuchMethodException or similar.
    Now here's the trick, jboss5 has jboss-logmanager included but it's the wrong version and just adding inifispan-core to your dependencies will not include the jboss-logmanager it needs. Define your pom.xml like this:

    (For infinispan 5.1.6.Final, it's supposed to be 1.2.0.GA)

    Enjoy infinispan 5.x on jboss5

    Now you will load 2 diffrent versions of jgroups, so make sure to make separate channels for regular jboss jgroups and infinispans. In the case you use TCPPING set it up like this:


  2. Dec 06, 2012

    To load infinispan 5.x inside an esb deployment on jboss SOA 5.x using maven to build follow these steps.

    Use the jboss-packaging-maven-plugin you normally would with <excludeAll> set to true.

    Then add the maven-dependency-plugin to manually add all infinispan dependencies for example like this:

    Make sure to config your <outputDirectory> so that the jars end up inside your esb deployment.

    Then scope your classloader in your deployment.xml like this:

    Also add jboss-classloading.xml in your META-INF folder

    Now you can instanciate an infinispan cache inside your esb (we use spring) and no more need to use jboss cache :)

    See previous comment to separate jgroups channels.