Infinispan 作为 Hibernate 2LC:NamedCacheNotFoundException

发布于 2024-12-01 21:58:06 字数 1319 浏览 2 评论 0原文

我目前使用 JBossCache 3.2 作为 Hibernate 二级缓存,用于 EJB3 环境 (GlassFish 2) 中实体的集群缓存,运行良好。现在我正在使用 Infinispan 4.2.1 进行评估,令我惊讶的是我得到了 NamedCacheNotFoundException

我在实体级别使用注释

@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL, region = "myRegion")

,例如

org.infinispan.CacheException: org.infinispan.manager.NamedCacheNotFoundException: Cache: myRegion
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:115)
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:126)
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:231)
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:218)
  at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:201)
  at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:194)
  at org.infinispan.interceptors.InvalidationInterceptor.invalidateAcrossCluster(InvalidationInterceptor.java:220)
  ....

通过jmx查看,我可以看到相应的MBean,但它的CacheName就像myRegion(invalidation_sync)。后缀(invalidation_sync)似乎是Infinispan添加的。

这是我的问题的根本原因吗?如何解决它?我的 Infinispan 配置主要是 hibernate-infinsipan 附带的配置,但启用了 jmx。

I currently use JBossCache 3.2 as a Hibernate 2nd level cache for clustered caching of entities in a EJB3 environment (GlassFish 2) which runs fine. Now I'm evaluating using Infinispan 4.2.1 instead and to my surprise I get NamedCacheNotFoundExceptions.

I use annotations at entity level like

@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL, region = "myRegion")

and the exeptions are like

org.infinispan.CacheException: org.infinispan.manager.NamedCacheNotFoundException: Cache: myRegion
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:115)
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:126)
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:231)
  at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:218)
  at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:201)
  at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:194)
  at org.infinispan.interceptors.InvalidationInterceptor.invalidateAcrossCluster(InvalidationInterceptor.java:220)
  ....

Looking via jmx I can see a corresponding MBean but it's CacheName is like myRegion(invalidation_sync). The suffix (invalidation_sync) seems to be added by Infinispan.

Is this the root cause of my problem? How to come around it? My Infinispan config is largely the one that comes with hibernate-infinsipan but with jmx enabled.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文