我在使用基于文件存储的缓存存储时遇到以下异常,缓存存储在多个节点之间共享。
Caused by: org.infinispan.commons.CacheException: Unable to start cache loaders
at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:168)
... 73 more
Caused by: org.infinispan.persistence.spi.PersistenceException: java.io.IOException: Unsupported protocol version 22
at org.infinispan.persistence.file.SingleFileStore.start(SingleFileStore.java:135)
at org.infinispan.persistence.manager.PersistenceManagerImpl.start(PersistenceManagerImpl.java:141)
... 78 more
Caused by: java.io.IOException: Unsupported protocol version 22
at org.jboss.marshalling.river.RiverUnmarshaller.start(RiverUnmarshaller.java:1249)
at org.infinispan.commons.marshall.jboss.AbstractJBossMarshaller.startObjectInput(AbstractJBossMarshaller.java:128)
at org.infinispan.marshall.core.VersionAwareMarshaller.startObjectInput(VersionAwareMarshaller.java:142)
at org.infinispan.marshall.core.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:98)
at org.infinispan.commons.marshall.AbstractDelegatingMarshaller.objectFromByteBuffer(AbstractDelegatingMarshaller.java:80)
at org.infinispan.persistence.file.SingleFileStore.rebuildIndex(SingleFileStore.java:212)
at org.infinispan.persistence.file.SingleFileStore.start(SingleFileStore.java:126)
... 79 more
这是我的缓存配置的样子:
<distributed-cache name="singletons">
<versioning scheme="SIMPLE"/>
<persistence passivation="false" >
<file-store
path="${infinispan.dir}/broker-ds/singletons"
fetch-state="true" shared="true" preload="true" />
</persistence>
</distributed-cache>
任何出错的线索?我使用的是Infinispan 8.1版本。
更新
我使用的是基于JDBC的共享存储,而不是基于共享文件的存储,而且工作正常。
答案 0 :(得分:4)
不幸的是,你还不能(还)使用多个节点之间共享的文件存储。使用专用于每个节点的目录或使用能够共享的存储(jdbc,jpa,cassandra)。