我正在使用ehcache-monitor-kit-1.0.3版本的Ehcache监视器。启动 ehcache 监视器服务器时,发生错误,指出
Exception in thread "CounterManagerImpl Timer" java.lang.NoSuchMethodError: net.
sf.ehcache.Ehcache.getStatistics()Lnet/sf/ehcache/Statistics;
at org.terracotta.ehcachedx.monitor.probe.SampledCacheStatistics$1.call(
SampledCacheStatistics.java:87)
at org.terracotta.ehcachedx.monitor.probe.SampledCacheStatistics$1.call(
SampledCacheStatistics.java:85)
我发现方法getStatistics()
在不同版本的ehcache-core-xx.jar的界面上有所不同,如果版本<2.7.0,那就是我需要的,但是当在pom中添加依赖项时
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.6.0</version>
</dependency>
,在本地存储库中,我找到了
14 10:59 _maven.repositories
14 10:59 ehcache-2.6.0.pom
14 10:59 ehcache-2.6.0.pom.sha1
,所以没有像这样的行
-rw-r--r-- 1 Administrator 197121 6718989 Aug 14 10:58 ehcache-2.7.0.jar
没有罐子,我该怎么办?
您尝试将ehcache
的版本升级到2.10.4
。 您可以在下面找到依赖项:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.4</version>
</dependency>