1

我有在 2.5.1 版本中开发的 Grails web 项目。它在 Tomcat 7.0.63 中运行良好。当我在 Tomcat 8.0.33 中部署相同的运行 WAR 文件时,它给出了 ehcache 错误:

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cache.ehcache.EhCacheFactoryBean]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.cache.ehcache.EhCacheFactoryBean.setMaxEntriesLocalHeap(J)V

我知道这是由于 ehcache 旧版本,但同样的战争在 Tomcat 7 中运行良好,那么,Tomcat 8 有什么问题?

任何帮助都会很棒。

谢谢。

更新:如果我用 Tomcat 7 替换 Tomcat 8 的所有 jar 文件,那么它可以工作。但这样做似乎很愚蠢。

4

1 回答 1

0

项目中有多个 ehcache jar 文件。休眠缓存和弹簧缓存,似乎弹簧缓存指向Tomcat8中的旧jar。我们强制排除ehcache-core并且它起作用了。

欲了解更多信息:排除插件

于 2016-05-17T09:04:49.887 回答