【问题标题】:Compile error in Grails ehcache pluginGrails ehcache 插件中的编译错误
【发布时间】:2014-08-07 05:49:20
【问题描述】:

刚刚添加到 BuildConfig.groovy:

    compile ":cache-ehcache:1.0.1"

我正在使用 Eclipse/Spring Tool Suite v 3.5.0.RELEASE

JAVA_HOME 设置为:E:\Program Files\Java\jdk1.7.0_17

运行 grails runApp 时出现以下编译错误。

Compilation error: startup failed:
Compile error during compilation with javac.
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:195: error: ReloadableCacheManager.ProxyEhcache is not abstract and does not override abstract method getSearchesPerSecond() in Ehcache
        protected class ProxyEhcache implements Ehcache {
                  ^
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:798: error: getStatistics() in ReloadableCacheManager.ProxyEhcache cannot implement getStatistics() in Ehcache
            public StatisticsGateway getStatistics()
                                     ^
  return type StatisticsGateway is not compatible with Statistics
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:656: error: cannot find symbol
                return getUnderlyingEhcache(name).getSearchAttributes();
                                                 ^
  symbol:   method getSearchAttributes()
  location: interface Ehcache
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:653: error: method does not override or implement a method from a supertype
            @Override
            ^

【问题讨论】:

  • 你有没有设法让它工作?我在使用 Grails 2.3.7 和 cache-ehcache:1.0.4 时遇到了同样的问题...
  • 我想最后我取出了 BuildConfig 对 ehcache 的依赖,而 GORM 最终将缓存模块拉入

标签: grails ehcache spring-tool-suite


【解决方案1】:

尝试删除 .grails 目录下的项目文件夹,例如'~/.grails/2.3.8/projects/osrpms'。

和命令

grails clean-all

grails clean

然后运行项目

【讨论】:

  • 还是没有运气。如果我更改为 1.0.0,至少插件会编译,但它会丢失:grails.plugin.cache.ehcache.hibernate.BeanEhcacheRegionFactory4 和 grails.plugin.cache.ehcache.hibernate.BeanEhcacheRegionFactory
猜你喜欢
  • 2015-02-03
  • 2013-12-03
  • 1970-01-01
  • 1970-01-01
  • 2012-01-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多