2013-08-06 42 views
1

我试图在一个JVM中创建一个本地缓存和一个客户端缓存,但是我得到了下面指出的错误,我认为这是由于缓存是单例而发生的,而且您只能创建一个每个JVM。Gemfire中的多个缓存创建

有没有人知道一个很好的解决办法?

错误:

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. 

Cache.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"/> 

回答

2

您不能定义在同一个JVM多个缓存。缓存是一个单身人士。请参阅 API docs