java - Hazelcast 实例在访问分布式地图时未激活
问题描述
我正在运行一个在嵌入式模式下使用 Hazelcast的应用程序。在访问缓存时间歇性地看到这个问题,应用程序抛出 Hazelcast instance is not active 错误。
代码文件如下:
public DistributedServiceProvider() {
LOGGER.info("DistributedServiceProvider: " + type);
if ("hazelcast".equalsIgnoreCase(type)) {
hazelcastInstance = HazelcastConfig.getInstance();
} else {
throw new Exception(NOT_CONFIGURED);
}
}
public IMap getMap(String name) {
if (hazelcastInstance != null) {
return hazelcastInstance.getMap(name);
}
throw new RuntimeException(NOT_INITIALIZED);
}
运行应用程序并执行某些用例时,间歇性地出现以下错误。
An exception has occurred. Method:: compareIRTrackerRedemptions[null, Fri Apr 30 00:00:00 EDT 2021, Mon May 31 00:00:00 EDT 2021, true]
Root Cause: com.hazelcast.core.HazelcastInstanceNotActiveException: Hazelcast instance is not active!
at com.hazelcast.instance.impl.HazelcastInstanceProxy.getOriginal(HazelcastInstanceProxy.java:315)
at com.hazelcast.instance.impl.HazelcastInstanceProxy.getMap(HazelcastInstanceProxy.java:95)
at deshaw.descap.server.cache.provider.DistributedServiceProvider.getMap(DistributedServiceProvider.java:52)
at deshaw.descap.server.cache.BasicCache.getData(BasicCache.java:100)
at deshaw.descap.server.cache.FundCaches$FundCache.get(FundCaches.java:185)
解决方案
推荐阅读
- python - “args”和“kwargs”哪一个在touple、list和dictionary中使用?
- android - 如何将自定义 AlertDialog 条目添加到 RecyclerView?
- java - java - 在将记录插入表之前如何处理java中的非空字段
- c# - 使用 StreamReader 读取文件时读取固定数量的字节
- wordpress - 可湿性粉剂 | 计算字段表单中的双端队列样式
- java - DAO 模式和服务层的模型对象
- javascript - Regular expression of decimal range 0.025 to 99.999
- azure - QnA Maker - 运行时错误:授权失败
- javascript - 如何从外部将键名从 ViewBag 传递给 JQuery
- ios - 收据数据验证信息未提供