【问题标题】:Grails 3 with Ehcache Plugin带有 Ehcache 插件的 Grails 3
【发布时间】:2017-02-27 11:13:59
【问题描述】:

我们正在尝试将 EHCache 插件与 Grails 3 一起使用。

在 build.gradle 文件中我们插入了以下配置:

compile "org.grails.plugins:cache"
compile("org.grails.plugins:cache-ehcache:1.0.5") {
    exclude module: "cache"
}

当为服务使用@Cachable 注解时,这些内容由核心插件的默认缓存管理缓存,而不是由 EHCache 缓存。这会导致无休止的缓存,直到应用程序重新启动。

grailsCacheManager 似乎没有设置为 GrailsEhcacheCacheManager 类。 有人用grails 3成功配置了EHCache插件并且可以提供配置吗?

【问题讨论】:

    标签: grails ehcache


    【解决方案1】:

    我发现了问题:对于 grails 3,SNAPSHOT 版本必须用于 grails 缓存插件。

    更多信息可在此处获得: https://github.com/grails-plugins/grails-cache-ehcache/issues/26

    我在 build.gradle 中的 EH Cache 插件配置现在看起来像这样:

    compile ("org.grails.plugins:cache-ehcache:3.0.0.BUILD-SNAPSHOT") {
        exclude group:'net.sf.ehcache'
    }
    // we have to downgrade the ehcache version. Otherwise it will not work together with hibernate ehcache
    compile "net.sf.ehcache:ehcache:2.4.3"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-03
      • 2013-04-23
      • 2017-10-29
      • 1970-01-01
      相关资源
      最近更新 更多