将Tomils 7中的Grails WAR文件部署到Tomcat 8会导致Ehcache错误

时间:2016-05-16 07:54:20

标签: spring-mvc tomcat7 ehcache tomcat8 grails-2.5

我有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文件,那么它可以工作。但这样做似乎是愚蠢的事情。

1 个答案:

答案 0 :(得分:0)

项目中有多个ehcache jar文件。 Hibernate缓存和spring缓存,看起来像Spring缓存指向Tomcat8中的旧jar。我们强制排除 ehcache-core 并且有效。

了解更多信息:Exclude plugin