Wildfly 10 infinispan batching
julien.guillot Apr 13, 2016 4:37 AMHello,
I'm getting error when using Infinispan Tree Cache API, because invocationBatching is not enabled:
10:24:54,899 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 31) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "test-wfy10-cache-tree.ear-0.0.0-SNAPSHOT.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"test-wfy10-cache-tree.ear-0.0.0-SNAPSHOT.ear\".\"test-wfy10-cache-tree.jar.jar\".component.TreeCacheBean.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"test-wfy10-cache-tree.ear-0.0.0-SNAPSHOT.ear\".\"test-wfy10-cache-tree.jar.jar\".component.TreeCacheBean.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance Caused by: javax.ejb.EJBException: org.infinispan.commons.CacheConfigurationException: invocationBatching is not enabled for cache 'testCache'. Make sure this is enabled by calling configurationBuilder.invocationBatching().enable() Caused by: org.infinispan.commons.CacheConfigurationException: invocationBatching is not enabled for cache 'testCache'. Make sure this is enabled by calling configurationBuilder.invocationBatching().enable()"}} 10:24:54,899 ERROR [org.jboss.as.server] (management-handler-thread - 31) WFLYSRV0021: Deploy of deployment "test-wfy10-cache-tree.ear-0.0.0-SNAPSHOT.ear" was rolled back with the following failure message: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"test-wfy10-cache-tree.ear-0.0.0-SNAPSHOT.ear\".\"test-wfy10-cache-tree.jar.jar\".component.TreeCacheBean.START" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"test-wfy10-cache-tree.ear-0.0.0-SNAPSHOT.ear\".\"test-wfy10-cache-tree.jar.jar\".component.TreeCacheBean.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance Caused by: javax.ejb.EJBException: org.infinispan.commons.CacheConfigurationException: invocationBatching is not enabled for cache 'testCache'. Make sure this is enabled by calling configurationBuilder.invocationBatching().enable()
cache configuration in standalone.xml is:
<cache-container name="testContainer" jndi-name="java:jboss/infinispan/container/testContainer"> <local-cache name="testCache"> <transaction mode="BATCH"/> </local-cache> </cache-container>
Application code:
@Startup @Singleton public class TreeCacheBean { @Resource(lookup = "java:jboss/infinispan/cache/testContainer/testCache") private Cache<String, String> testBaseCache; @PostConstruct public void onStartup() { new TreeCacheFactory().createTreeCache(this.testBaseCache); } }
Isn't <transaction mode="BATCH"/> enough to enable invocationBatching? Or is there something wrong in my code?
Full example: GitHub - julien-guillot/test-wfy10-cache-tree: Test Wildfly 10 Infinispan Tree Cache API