【问题标题】:Deploying Grails WAR file from Tomcat 7 to Tomcat 8 gives Ehcache error将 Grails WAR 文件从 Tomcat 7 部署到 Tomcat 8 会导致 Ehcache 错误
【发布时间】:2016-05-16 07:54:20
【问题描述】:

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

【问题讨论】:

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


    【解决方案1】:

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

    欲了解更多信息:Exclude plugin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-03
      • 2012-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-08
      相关资源
      最近更新 更多