在升级到infinispan 8.2.2后尝试启动缓存时Infinispan超时。
我使用以下配置:
Configuration createConfiguration(boolean persistent) {
LockingConfigurationBuilder confBuilder = new ConfigurationBuilder().clustering().cacheMode(CacheMode.REPL_SYNC).sync()
.replTimeout(60, TimeUnit.SECONDS)
.persistence()
.passivation(Boolean.FALSE)
.addClusterLoader().preload(false).shared(Boolean.FALSE)
.remoteCallTimeout(60, TimeUnit.SECONDS)
.transaction()
.transactionMode(TransactionMode.TRANSACTIONAL)
.transactionManagerLookup(new JBossStandaloneJTAManagerLookup())
.syncRollbackPhase(Boolean.TRUE)
.syncCommitPhase(Boolean.TRUE)
.lockingMode(LockingMode.PESSIMISTIC)
.cacheStopTimeout(30000l)
.useSynchronization(true)
.recovery().disable().locking();
confBuilder.clustering().stateTransfer().timeout(2, TimeUnit.MINUTES);
if(persistent) {
confBuilder.persistence().addSingleFileStore()
.location("/somepath").fetchPersistentState(Boolean.TRUE)
.preload(false).purgeOnStartup(false)
.expiration().lifespan(-1, TimeUnit.DAYS);
}
confBuilder.validate();
return confBuilder.build();
}
看到以下信息后:
2016-06-10 12:17:53,349 INFO [CacheStartThread,null,XXX] lookup.JBossStandaloneJTAManagerLookup (JBossStandaloneJTAManagerLookup.java:56) - ISPN000107: Retrieving transaction manager Transaction: unknown
在抛出此错误之前,应用程序会超时一段时间(超时可在我们的代码中配置):
org.infinispan.util.concurrent.TimeoutException: ISPN000402: Timeout waiting for view 0. Current view is 0, current status is RECOVERING_CLUSTER
at org.infinispan.topology.ClusterTopologyManagerImpl.waitForJoinerView(ClusterTopologyManagerImpl.java:535) ~[infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.topology.ClusterTopologyManagerImpl.handleJoin(ClusterTopologyManagerImpl.java:207) ~[infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.topology.CacheTopologyControlCommand.doPerform(CacheTopologyControlCommand.java:171) ~[infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.topology.CacheTopologyControlCommand.perform(CacheTopologyControlCommand.java:153) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.topology.LocalTopologyManagerImpl.executeOnCoordinator(LocalTopologyManagerImpl.java:606) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.topology.LocalTopologyManagerImpl.join(LocalTopologyManagerImpl.java:139) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.statetransfer.StateTransferManagerImpl.start(StateTransferManagerImpl.java:110) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_91]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_91]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_91]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_91]
at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168) [infinispan-commons-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:859) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:628) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:617) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:542) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:238) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:849) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:635) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:585) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.manager.DefaultCacheManager.access$100(DefaultCacheManager.java:125) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
at org.infinispan.manager.DefaultCacheManager$1.run(DefaultCacheManager.java:485) [infinispan-core-8.2.2.Final.jar:8.2.2.Final]
2016-06-10 12:18:54,516 WARN [CacheStartThread,null,KeyCache] topology.CacheTopologyControlCommand (CacheTopologyControlCommand.java:159) - ISPN000071: Caught exception when handling command CacheTopologyControlCommand{cache=KeyCache, type=JOIN, sender=oliver-Predator-4829, joinInfo=CacheJoinInfo{consistentHashFactory=org.infinispan.distribution.ch.impl.SyncReplicatedConsistentHashFactory@65541715, hashFunction=MurmurHash3, numSegments=256, numOwners=2, timeout=60000, totalOrder=false, distributed=false}, topologyId=0, rebalanceId=0, currentCH=null, pendingCH=null, availabilityMode=null, actualMembers=null, throwable=null, viewId=0}
我的pom.xml:
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>8.2.2.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.jbossts</groupId>
<artifactId>jbossjta</artifactId>
<version>4.16.6.Final</version>
这与this issue。
有关