我正在从 Wildfly 8.2 迁移到 10.1 不幸的是,我遇到了 Infinispan TreeCache 的问题。
这里有几个问题:
- Wildfly 10 配置中不再支持调用批处理
这是我的配置:
<subsystem xmlns="urn:jboss:domain:infinispan:4.0"> ... <cache-container name="my_container" default-cache="my_tree_cache" jndi-name="java:jboss/my_container"> <transport lock-timeout="60000"/> <local-cache name="my_cache"/> <local-cache name="my_tree_cache" batching="true"/> </cache-container> </subsystem>
启动时出错:
> Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[345,17]
> Message: WFLYCTL0197: Unexpected attribute 'batching' encountered
- 如果我删除“批处理”属性。我收到此错误:
com.daiwacm.modjsf.dataaccess.DataException: getTreeCache has failed for jndi value (my_tree_cache) Caused by: org.infinispan.commons.CacheConfigurationException: invocationBatching is not enabled for cache 'my_tree_cache'. Make sure this is enabled by calling configurationBuilder.invocationBatching().enable()
- 如果我以编程方式设置批处理:
Context context = new InitialContext(); CacheContainer cacheContainer = (CacheContainer) context.lookup(jndiName); TreeCacheFactory tcf = new TreeCacheFactory(); Cache cache = cacheContainer.getCache(cacheName); cache.getCacheManager().defineConfiguration(cacheName, new ConfigurationBuilder().read(cache.getCacheConfiguration()).invocationBatching().enable().build()); TreeCache treeCache = tcf.createTreeCache(cache);
我收到此错误:
> Caused by: org.infinispan.commons.CacheConfigurationException:
> ISPN000381: This configuration is not supported for simple cache
> at org.infinispan.configuration.cache.ConfigurationBuilder.validateSimpleCacheConfiguration(ConfigurationBuilder.java:219)
> ...
> at org.infinispan.configuration.cache.InvocationBatchingConfigurationBuilder.build(InvocationBatchingConfigurationBuilder.java:12)
> ...