Infinispan 作为 Hibernate 2LC:NamedCacheNotFoundException
我目前使用 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 NamedCacheNotFoundException
s.
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论