使用Spring Data找不到Gemfire Region

时间:2014-07-14 02:49:32

标签: gemfire spring-data-gemfire

我能够成功运行spring-gemfire-examples-master / spring-cache项目。但是,当我尝试连接我的本地定位器时,它告诉我在GemfireCache中找不到region1。但是,我可以在Pulse中看到已建立连接。 我的步骤:

  1. 打开一个窗口命令,启动一个locator1,启动一个server1,创建一个region1
  2. 将样本文件夹中的spring-cache ... cache-context.xml更改为

  3. 相应地更改cacheManager。

  4. 以gradlew -q run-spring-cache

  5. 运行sample

    我是Gemfire的新手。

    <util:properties id="gemfire-props">
        <prop key="log-level">warning</prop>
    </util:properties>
    <gfe:client-cache id="client-cache"   pool-name="my-pool"></gfe:client-cache>
    <gfe:pool id="my-pool" subscription-enabled="true">
     <gfe:locator host="localhost" port="10334"></gfe:locator>
    </gfe:pool>
    <gfe:lookup-region id="Region1" name="Region1" cache-ref="client-cache">
    </gfe:lookup-region>
    

1 个答案:

答案 0 :(得分:1)

在这种情况下,您需要使用

<gfe:client-region id="Region1" name="Region1" cache-ref="client-cache"/>

lookup-region与缓存对等体相关联;客户端区域与客户端缓存一起使用。另外,相应地修改Main.java以加载cache-context.xml。