the Problem with the current version is that the creation of the TreeCache instance failes.
First i get a normal Cache instance from the CacheContainer with:
org.infinispan.Cache<String, Object> infiniCache = this.cacheContainer.getCache("mycachegoeshere");
then I try to create a new TreeCache instance:
TreeCache<String, Object> tc = new TreeCacheFactory().createTreeCache(infiniCache)
This failes with 5.1.4 because of the 'instanceof' check in AbstractDelegatingCacheImpl:
if (cache instanceof CacheImpl) this.cache = (CacheImpl<K, V>) cache; else throw new IllegalArgumentException("This adapter only works with CacheImpl, not with " + cache.getClass().getSimpleName());
This is because the cache I got from the container is not an instance of type CacheImpl but AbstractDelegatingCache.
I am seeing this too - JBoss AS7 does not seem to be using CacheImpl for container-configured caches.
Perhaps this is more of an AS7 issue? Is there a way to get AS7 to create CacheImpl caches?
this bug will be fixed with infinispan 5.1.5Final.