Hi, I´m using hibernate-memcached in a Grails application (Grails 2.2.4) and I have problem with custom KeyStrategy. If I create a class implementing KeyStrategy inside the Grails application (src/java or src/groovy) then I get ClassNotFoundException during Grails app startup. It seems to me that it's due to classloader issues.
Caused by: java.lang.ClassNotFoundException: EntityKeyStrategy
at java.lang.Class.forName(Class.java:169)
at com.googlecode.hibernate.memcached.MemcachedCacheProvider.instantiateKeyStrategy(MemcachedCacheProvider.java:131)
I found in grails forums that it should be loaded with:
Class clazz = Class.forName(className, true, Thread.currentThread().contextClassLoader)
instead of just
Class clazz = Class.forName(className)
Is there any aother solution or could it be changed in MemcachedCacheProvider?
In fact I am too lazy to create a separate library with just one class, which would solve it also...
Thanks.