Spring bean creation failing due to java.lang.NoClassDefFoundError: net/sf/ehcache/Ehcache
Issue
- Trying to use the
org.apache.cxf.rs.security.oauth2.provider.DefaultEHCacheOAuthDataProviderfor our oauth implementation but its throwing an exception because it cant find thenet/sf/ehcache/Ehcache definitionin any of the installedbundles. Could you please point me to right direction on this, below is the exception
Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/Ehcache
at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.8.0_45]
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)[:1.8.0_45]
at java.lang.Class.getConstructor0(Class.java:3075)[:1.8.0_45]
at java.lang.Class.getDeclaredConstructor(Class.java:2178)[:1.8.0_45]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)[168:org.apache.servicemix.bundles.spring-beans:3.2.12.RELEASE_2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1032)[168:org.apache.servicemix.bundles.spring-beans:3.2.12.RELEASE_2]
... 15 more
Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.Ehcache not found by org.apache.cxf.cxf-rt-rs-security-oauth2 [266]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)[org.apache.felix.framework-4.4.1.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_45]
Environment
- Red Hat JBoss Fuse
- 6.2.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
