我有一个应用程序,使用hibernate和EHCache作为第二层缓存。我想监控缓存的活动,于是我找到了ehcache- monitor of工具,这个工具看起来很不错。
在遵循自述文件中的说明之后,我在类路径中添加了echcache-probe jar,并定义了:
<cacheManagerPeerListenerFactory
class="org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory"
properties="monitorAddress=127.0.0.1, monitorPort=9889, memoryMeasurement=true" /> 应用程序将不再启动并失败,并出现异常:
Caused by: java.lang.ClassCastException: org.terracotta.ehcachedx.monitor.probe.ProbePeerListenerFactory cannot be cast to net.sf.ehcache.distribution.CacheManagerPeerListenerFactory
at net.sf.ehcache.config.ConfigurationHelper.createCachePeerListeners(ConfigurationHelper.java:163)
at net.sf.ehcache.CacheManager.configure(CacheManager.java:786)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:471)
at net.sf.ehcache.CacheManager.init(CacheManager.java:395)
... 79 more我使用ehcache-probe-1.0.3和ehcache 2.9.1。
你知道怎么克服这个问题吗?
发布于 2015-12-02 19:48:25
我猜你们的版本是不兼容的。需要探测类型,但获得了不同的探测类型-因此类转换。这不应该发生在匹配的系统中,所以我怀疑不匹配。
由于Maven central中的最新探测器是1.0.2,所以即使比您的更老,我也会说这个工具无法工作。
但是,从2.7开始,EHCache似乎有了monitor built-in,这是怎么回事?
https://stackoverflow.com/questions/30679048
复制相似问题