I'm trying to use the latest version of the grails ehcache plugin (1.0.4) in my grails application, however when I add the plugin as a dependency in BuildConfig.groovy I get a compile error on startup:
| Error Compilation error: startup failed:
Compile error during compilation with javac.
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:202: error: ReloadableCacheManager.ProxyEhcache is not abstract and does not override abstract method getSearchesPerSecond() in Ehcache
protected class ProxyEhcache implements Ehcache {
^
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:805: error: getStatistics() in ReloadableCacheManager.ProxyEhcache cannot implement getStatistics() in Ehcache
public StatisticsGateway getStatistics()
^
return type StatisticsGateway is not compatible with Statistics
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:663: error: cannot find symbol
return getUnderlyingEhcache(name).getSearchAttributes();
^
symbol: method getSearchAttributes()
location: interface Ehcache
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:660: error: method does not override or implement a method from a supertype
@Override
^
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:758: error: cannot find symbol
return getUnderlyingEhcache(name).calculateOnDiskSize();
^
symbol: method calculateOnDiskSize()
location: interface Ehcache
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:755: error: method does not override or implement a method from a supertype
@Override
^
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:765: error: cannot find symbol
return getUnderlyingEhcache(name).getAll(arg0);
^
symbol: method getAll(Collection)
location: interface Ehcache
where CAP#1 is a fresh type-variable:
CAP#1 extends Object from capture of ?
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:761: error: method does not override or implement a method from a supertype
@Override
^
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:770: error: cannot find symbol
return getUnderlyingEhcache(name).hasAbortedSizeOf();
^
symbol: method hasAbortedSizeOf()
location: interface Ehcache
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:768: error: method does not override or implement a method from a supertype
@Override
^
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:777: error: cannot find symbol
getUnderlyingEhcache(name).putAll(arg0);
^
symbol: method putAll(Collection)
location: interface Ehcache
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:773: error: method does not override or implement a method from a supertype
@Override
^
/Users/rcgeorge23/Documents/workspace/grails-cache-ehcache/src/java/grails/plugin/cache/ehcache/GrailsEhCacheManagerFactoryBean.java:783: error: method putIfAbsent in interface Ehcache cannot be applied to given types;
return getUnderlyingEhcache(name).putIfAbsent(arg0, arg1);
^
required: Element
found: Element,boolean
Has anyone else had this problem? I notice the ehcache plugin is still being maintained, so I guess it works with current versions of grails, however I can't seem to get it to work for me. I've also tried cloning the latest commit from the grails-ehcache project in github and referencing this as a local plugin project, but I still get the same compile error.
I'm using Grails 2.3.7.
EDIT 1:
I was able to get my app to start up using version 1.0.0 of the ehcache plugin, although I imagine I'm probably missing out on some important enhancements if I use this version...
EDIT 2:
Ok for now, I've just cloned version 1.0.0 from github and cherry picked the fix for the TTL defect (https://jira.grails.org/browse/GPCACHEEHCACHE-6). It'd be good to find out why I can't get 1.0.4 working, but I have a workaround for now.
grails clean-allandgrails clean(can't hurt). - nickdos