Details
-
Bug
-
Resolution: Done
-
Major
-
5.1.1.FINAL
-
None
Description
Hello,
trying to get the treecache working inside a JBoss AS7 7.1.0-x, there is a problem within the configuration parameter "invocationBatching". Although batching is enabled, treecache is not recognizing it.
I think the reason is that treecache is using the deprecated configuration API. (e.g. TreeCacheFactory#createTreeCache)
AS7 cache configurations:
<cache-container name="myappCache" default-cache="repl"> <local-cache name="default" batching="true"> <eviction strategy="LRU"/> </local-cache> <distributed-cache mode="SYNC" name="repl" batching="true"> <locking isolation="REPEATABLE_READ"/> </distributed-cache> </cache-container> ...
Example usage:
@Singleton public class CacheServiceBean { @Resource(mappedName = "java:jboss/infinispan/myappCache") CacheContainer infinispanCacheContainer; TreeCache tc; @PostConstruct public void init(){ this.tc = new TreeCacheFactory().createTreeCache(infinispanCacheContainer.getCache()); } }
Resulting exception:
org.infinispan.config.ConfigurationException: invocationBatching is not enabled. Make sure this is enabled by calling config.setInvocationBatchingEnabled(true)
at org.infinispan.tree.TreeCacheFactory.createTreeCache(TreeCacheFactory.java:55) [infinispan-tree-5.1.0.CR1.jar:5.1.0.CR1]
at com......CacheServiceBean.init(CacheServiceBean.java:35) [example-base-ejb-0.0.1-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_29]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_29]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_29]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_29]
at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130) [jboss-as-ee-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:73) [jboss-as-weld-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:112) [jboss-as-ee-7.1.0.Final-SNAPSHOT.jar:7.1.0.Final-SNAPSHOT]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]