0 Replies Latest reply on Jan 4, 2012 11:48 PM by Brent Douglas

    infinispan-tree @Inject methods not working in CR1 but fixed in CR2

    Brent Douglas Newbie

      I couldn't find any reference to this around so I'm posting this to save anyone who runs into this issue the hassle of tracking down the fix. The solution is to upgrade to CR2.


      The stacktrace I encountered is:


      Caused by: org.infinispan.CacheException: Unable to start batch
                at org.infinispan.batch.BatchContainer.startBatch(BatchContainer.java:81) [infinispan-core-5.1.0.CR1.jar:5.1.0.CR1]
                at org.infinispan.batch.AutoBatchSupport.startAtomic(AutoBatchSupport.java:45) [infinispan-core-5.1.0.CR1.jar:5.1.0.CR1]
                at org.infinispan.tree.TreeStructureSupport.exists(TreeStructureSupport.java:47) [infinispan-tree-5.1.0.CR1.jar:]
                at org.infinispan.tree.TreeCacheImpl.createRoot(TreeCacheImpl.java:465) [infinispan-tree-5.1.0.CR1.jar:]
                at org.infinispan.tree.TreeCacheImpl.<init>(TreeCacheImpl.java:55) [infinispan-tree-5.1.0.CR1.jar:]
                at org.infinispan.tree.TreeCacheImpl.<init>(TreeCacheImpl.java:47) [infinispan-tree-5.1.0.CR1.jar:]
                at org.infinispan.tree.TreeCacheFactory.createTreeCache(TreeCacheFactory.java:59) [infinispan-tree-5.1.0.CR1.jar:]
                ... 205 more
      Caused by: java.lang.NullPointerException
                at org.infinispan.batch.BatchContainer.startBatch(BatchContainer.java:61) [infinispan-core-5.1.0.CR1.jar:5.1.0.CR1]
                ... 213 more


      Which is similar but not the same to the only real reference to a CacheException on the net at https://issues.jboss.org/browse/ISPN-1089 . The proposed solution does not work (causing much frustration) when using a tree cache as the transaction manager does not get injected resulting in the NPE.


      Hopefully this saves someone in the process of moving to AS7 some time as infinispan CR1 is provided with AS7 CR1. To fix it copy the CR2 jar into $AS7/modules/org/infinispan/main and change the version number in the modules.xml in that directory. After that your copy of infinispan-tree should be scanned fine.