0

春のアプリケーションでデータを照会するように Java gemfire テンプレートを構成しようとしています。
Spring テンプレートを作成するには、クライアント リージョンを作成する必要があります。クライアント リージョンを作成するには、クライアント キャッシュを作成する必要があります。クライアント キャッシュを作成するには、プールを作成する必要があります。
プール パラメータの 1 つに server-goup があります。それらのいくつかを照会するには、gemfire テンプレートが必要です。
複数のサーバー グループに対して構成可能なプールが見つからなかったので、2 つのプール (異なるサーバー グループを使用) を作成しました。

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>

ありがとう。

4

1 に答える 1