当前位置: 首页 > 知识库问答 >
问题:

Gemfire配置问题

公孙霖
2023-03-14

我有一个xml配置文件用于设置gemfire,如下所示

<?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:context="http://www.springframework.org/schema/context"
    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/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:component-scan
        base-package="com.mycompany.data.testcache" />
    <context:annotation-config />

    <util:properties id="props" location="classpath:test-cache.properties">
        <prop key="log-level">info</prop>
    </util:properties>

    <gfe:cache id="gemfire-cache" properties-ref="props" />

    <gfe:local-region id="region1">
        <gfe:cache-listener ref="listener" />
    </gfe:local-region>

    <bean id="listener"
        class="com.mycompany.data.TestLoggingCacheListener" />
</beans>
<gfe:cache id="gemfire-cache" properties-ref="props" />
<gfe:cache properties-ref="props" />

工作很好。当我指定id属性时,它会抛出t任何一个都可以,请帮助我

共有1个答案

通令
2023-03-14

如果您将id属性与gfe:cache元素一起使用,那么您就必须使用cache-ref属性来引用它:

<gfe:cache id="gemfire-cache" properties-ref="props" />

<gfe:local-region id="region1" cache-ref="gemfire-cache">
    <gfe:cache-listener ref="listener" />
</gfe:local-region>

否则,将使用默认id“gemfirecache”(这就是您在错误消息中看到“gemfirecache”的原因)。

 类似资料:
  • Pivotal GemFire 是内存中的分布式数据库,提供: 性能扩展 通过全局的分布式应用进行一致的数据库操作 高可用性和高伸缩性,全局规模 强大的开发者特性 简单的分布式节点管理 作为世界规模最大的实时交易系统之一12306就是使用的#GemFire#

  • 假设我有Gemfire定位器 我有一个Spring 3.1 MVC应用程序,它想要使用Gemfire缓存。我使用的是Spring数据Gemfire 1.2.2和Gemfire 6.6.1 因此,我将以下内容添加到我的 假设外部JAR依赖项都在Maven中正确定义。还假设我加载了一个属性文件,该文件定义了上面引用的属性值。定位器属性定义为使用已经启动的Gemfire定位器的IP和端口。 我相信这应该

  • Spring GemFire Integration 是一个顶级的 Spring 项目,主要用来简化通过 GemFire 分布式数据管理平台来部署高可伸缩性的 Spring 应用,包含 Java 和 .NET 版本。

  • 简而言之,当在方法上调用@CacheEvict并且没有找到条目的键时,Gemfire会抛出EntryNotFoundException。 现在详细介绍一下, 我有课 我有两个缓存区域,定义为个人区域和个人部门区域,服务如下 当调用updatePerson时,如果personByDeptRegion中没有条目,则会抛出一个异常,即键1的EntryNotFoundException(或dept代码)。

  • 我是android开发领域的新手。下载Android Studio后,我尝试运行我的第一个HelloWorld。但是Android Studio给了我任何我不知道如何解决的问题。 在类

  • 我正在尝试将log4j2.0配置为报告日志。 我的配置保存为log4j2.xml,这是它的内容: 它存在于项目的类路径中,我试着把它放在许多其他目录中... 我在代码中创建了一个记录器,如下所示: 没有任何东西被写入,也没有文件被创建。当我调试代码时,我看到记录器是默认的记录器(控制台)。