没有定义[com.gemstone.gemfire.cache.GemFireCache]类型的唯一bean:期望的单个bean但找到了2

时间:2014-03-13 15:26:01

标签: java spring gemfire spring-data-gemfire

我正在尝试配置java gemfire模板以在spring应用程序中查询数据 要创建spring模板,我需要创建client-region,创建客户端区域,我需要创建客户端缓存,创建我需要创建池的客户端缓存。
其中一个池参数是server-goup。我需要gemfire模板来查询其中的几个 我没有找到可配置多个服务器goups的池,因此我创建了两个池(具有不同的服务器goups)两个客户端缓存两个客户端区域和两个模板并且出错。

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.gemstone.gemfire.cache.GemFireCache] is defined: expected single bean but found

我缺少什么?我如何修复错误或管理为多个服务器组设置客户端区域?

这是春天的背景:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:gfe="http://www.springframework.org/schema/gemfire"
    xmlns:util="http://www.springframework.org/schema/util" 
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
        http://www.springframework.org/schema/data/gemfire http://www.springframework.org/schema/data/gemfire/spring-data-gemfire.xsd">

    <gfe:pool id="mdfClientDataPool" subscription-enabled="true" server-group="clientData">
        <gfe:locator host="${gemfire.locator.primary.1}" port="${gemfire.locator.primary.port.1}" />
    </gfe:pool>
    <gfe:client-cache id="mdfClientDataCache" pool-name="mdfClientDataPool" properties-ref="gemfireProperties" />
    <gfe:client-region id="mdfClientDataRegion" cache-ref="mdfClientDataCache" />
    <bean id="mdfClientDataTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="mdfClientDataRegion" />

    <gfe:pool id="mdfInstrumentDataPool" subscription-enabled="true" server-group="instrumentData">
        <gfe:locator host="${gemfire.locator.primary.1}" port="${gemfire.locator.primary.port.1}" />
    </gfe:pool>
    <gfe:client-cache id="mdfInstrumentCache" pool-name="mdfInstrumentDataPool" properties-ref="gemfireProperties" />
    <gfe:client-region id="mdfInstrumentRegion" cache-ref="mdfInstrumentCache" />
    <bean id="mdfInstrumentTemplate" class="org.springframework.data.gemfire.GemfireTemplate" p:region-ref="mdfInstrumentRegion" />

</beans>

感谢。

1 个答案:

答案 0 :(得分:1)

池上有一个服务器组属性。您应该能够创建多个客户端区域,每个客户端区域都有自己的池和一个客户端缓存。只能有一个缓存实例。

相关问题