Problems with custom KeyStrategy and Grails classloader

50 views
Skip to first unread message

Wenca

unread,
Aug 8, 2013, 11:49:58 AM8/8/13
to hibernate...@googlegroups.com
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.

Ray Krueger

unread,
Aug 8, 2013, 12:03:51 PM8/8/13
to hibernate...@googlegroups.com
I think you might have a different classpath issue going on. Hibernate-memcached is used with Grails a lot, there's even an official plugin at http://grails.org/plugin/memcached

Is that what you're using?


--
You received this message because you are subscribed to the Google Groups "hibernate-memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hibernate-memca...@googlegroups.com.
To post to this group, send email to hibernate...@googlegroups.com.
Visit this group at http://groups.google.com/group/hibernate-memcached.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Wenca

unread,
Aug 14, 2013, 4:52:51 AM8/14/13
to hibernate...@googlegroups.com
Hi Ray,
yes I use the hibernate-memcached plugin.
Reply all
Reply to author
Forward
0 new messages