1

我正在尝试在一个 JVM 中创建一个本地缓存和一个客户端缓存,但是我收到下面所述的错误,我认为这是由于缓存是单例的,您只能为每个 JVM 创建一个。

有人知道一个好的解决方法吗?

错误:

Error creating bean with name 'ccf': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: The singleton cache was created by CacheFactory not ClientCacheFactory.

缓存.xml:

<gfe:cache id="localCache"/> 

<gfe:client-cache id="ccf" pool-name="gfPool" properties-ref="clientCacheProperties" />

<gfe:pool id="gfPool" subscription-enabled="true" load-conditioning-interval="6000" socket-buffer-size="65535" thread-local-connections="true" read-timeout="6000"
    idle-timeout="6000" retry-attempts="-1" ping-interval="5000" max-connections="-1">
    <gfe:locator host="127.0.0.1" port="10083" />
</gfe:pool>

<gfe:local-region id="localRegion"  cache-ref="localCache"/> 

<gfe:client-region id="region" cache-ref="ccf" pool-name="gfPool" name="regionName" shortcut="CACHING_PROXY"/>
4

1 回答 1

3

您不能在同一个 JVM 中定义多个缓存。缓存是单例。请参阅API 文档

于 2013-11-06T19:17:33.803 回答