3

I am getting weird errors on Heroku cedar using hibernate-memcached 1.3:

Caught CNFE decoding 438 bytes of data java.lang.ClassNotFoundException: org.hibernate.cache.entry.CacheEntry

Somehow hibernate-memcached 1.3 is failing to work with spymemcached 2.8.1 and up. It does not matter if i explicitly list spymemcached 2.7.3 in my pom.xml or i set spymemcached scope as provided - i always get CNFE

I was able to replicate this issue locally when i upgraded to spymemcached 2.8.1

Thanks.

1 Answers1

2

If you are using webapp-runner.jar to run your app, then yes, you're right: spymemcached class files are contained in the jar file to support caching of session data.

According to webapp-runner this is true for version 7.0.29.1 or newer.

The most recent version that does not contain spymemcached classes I was able to find, though, is 7.0.22.1.

I suspect that you can work around your problem by downgrading webapp-runner to version 7.0.22.1.

At least that worked for me when I ran into similar problems, getting exceptions like this:

org.springframework.beans.factory.CannotLoadBeanClassException:
Error loading class [net.spy.memcached.spring.MemcachedClientFactoryBean] 
for bean with name 'memcachedClient' defined in class path resource [memcached-context.xml]:
problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError: org/springframework/beans/factory/FactoryBean

These problems only occurred when I ran my war file with webapp-runner.jar. Running it from within Eclipse or with a local plain vanilla Tomcat 7 worked just fine.

Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99