作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
xml:
<gfe:client-cache id="gemfireCache" pool-name="gemfirePool"/>
<gfe:pool id="gemfirePool" max-connections="1000" server-group="datastore" read-timeout="60000"
subscription-enabled="true" pr-single-hop-enabled="false" >
<gfe:locator host="host" port="12345" />
</gfe:pool>
java:
Pool clientPool=PoolManager.find("gemfirePool");
Map<String,Pool> mapPool=PoolManager.getAll();
System.out.println("clientPool:"+clientPool);
System.out.println("mapPool:"+mapPool);
clientPool 为 null,mapPool 也为 null。
为什么?请最佳答案
您应该坚持一种方法:要么使用纯 GemFire API或纯spring-data-gemfire API ,不能同时两者,因为可能会出现一些不兼容的情况,就像这个一样。
也就是说,我的猜测(尚未测试)是 PoolManager
( GemFire 类)无法访问由 PoolFactoryBean
( spring-data-gemfire 类)。
如果您通过 spring-data-gemfire 配置缓存并且您想要访问 Pool
实例,您需要通过不同的 spring 容器机制之一来执行此操作:@Autowire
、applicationContext.getBean(Pool.class )
等
干杯!
关于java - gemfire客户端获取池为空.gemfire9.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45179952/
我是一名优秀的程序员,十分优秀!