Saturday, December 28, 2013

java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException

Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException

Problem:  
You need to add ehcache*.jar(for example ehcache.2.7.4.jar) file into your classpath.

Solution:  
 Add the ehcache*.jar file to your class path or specify the maven dependency in pom.xml file.

<dependency>
   <groupId>net.sf.ehcache</groupId>
   <artifactId>ehcache</artifactId>
   <version>2.7.4</version>
</dependency>  

0 comments: