java.lang.ClassNotFoundException: net.sf.ehcache.CacheManager
Asked on January 31, 2015
I am starter for JSF. I am using ehcache in my JSF application. I found the exception as below.
java.lang.ClassNotFoundException: net.sf.ehcache.CacheManager
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
org.primefaces.cache.EHCacheProvider.<init>(EHCacheProvider.java:27)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
Replied on January 31, 2015
You need JAR for net.sf.ehcache.CacheManager.
You can achieve it as below using gradle
compile 'net.sf.ehcache:ehcache:2.9.0'
and maven as
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.9.0</version>
</dependency>