ClassCastException when creating cache provider

70 views
Skip to first unread message

Brad Wood

unread,
May 6, 2013, 6:52:26 PM5/6/13
to hibernate...@googlegroups.com
I am trying to get hibernate-memcached up and running and encounter this error:

Caused by: java.lang.ClassCastException: com.googlecode.hibernate.memcached.MemcachedCacheProvider cannot be cast to org.hibernate.cache.CacheProvider
	at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)
	... 50 more

From what I can tell, my build of hibernate-memcached's MemcachedCacheProvider.java seems to correctly implement all the methods 

I will happily provide the full stack or additional config options if required.

My environment is ColdFusion 10, which is essentially a J2EE app in Tomcat.  Hibernate version is 3.5.2.

Thanks!

~Brad

Brad Wood

unread,
May 6, 2013, 10:56:43 PM5/6/13
to hibernate...@googlegroups.com
Ok, no sooner did I post this and then I think I got it figured out.  I know exactly what I changed, but since my Java is a little rusty I'm not entirely sure why it fixed it.  Basically my CFML server was running in a different context than Tomcat so I had copied all the related jars into that separate WEB-INF/lib directory which was not where the "real" hibernate jars were located that the rest of the app was using.  My dim understanding of classpaths is probably to blame.  I rearranged so everything was in the same classpath and I didn't have copies of the jars and it just started working.  If anyone's interested I can explain that more, or if you think you know why I was receiving that error, I'd love to learn.  Otherwise I think we can consider this working.

Thanks!

~Brad
Reply all
Reply to author
Forward
0 new messages