File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Application Frameworks and the fly likes error with hibernate3 and spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "error with hibernate3 and spring" Watch "error with hibernate3 and spring" New topic

error with hibernate3 and spring

Erwin Bredford
Ranch Hand

Joined: Feb 11, 2003
Posts: 167
hi ranchers
i am having a problem runing my spring app it is combine with hibernate working as my orm and i am running on JBoss.
this is error it gives me can't find net/sf/ehcache/CacheExceptionnet.sf.encache .
i don't get it this class doesnot exist in hibernate3 and hibernate2 jars

please could you help?
2005-11-24 17:35:08,343 INFO [org.hibernate.cfg.SettingsFactory] Second-level cache: enabled
2005-11-24 17:35:08,343 INFO [org.hibernate.cfg.SettingsFactory] Query cache: disabled
2005-11-24 17:35:08,359 INFO [org.hibernate.cfg.SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
2005-11-24 17:35:08,374 INFO [] Destroying singletons in factory { defining beans [propertyConfigurer,dataSource,sessionFactory,transactionManager]; parent: defining beans [messageSource]; root of BeanFactory hierarchy}
2005-11-24 17:35:08,390 ERROR [org.springframework.web.servlet.DispatcherServlet] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/box79-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(
at java.lang.Class.getConstructor0(
at java.lang.Class.newInstance0(
at java.lang.Class.newInstance(
at org.hibernate.cfg.SettingsFactory.createCacheProvider(
at org.hibernate.cfg.SettingsFactory.buildSettings(
at org.hibernate.cfg.Configuration.buildSettings(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(

--One learns a lot during a lesson but seeing is not enough,you must do;knowing is not enough ,you must apply--<br />SCJP 1.4,SCBCD,SCEA part 1,OCM JEE Enterprise Architect.
Juan Pablo Ram�rez

Joined: Mar 04, 2006
Posts: 2
This is the jar you need ehcache-1.1.jar put it inside WEB-INF/lib (and your claspath for compile and run)
Sri Jad
Ranch Hand

Joined: Apr 25, 2005
Posts: 49
Thanks Juan Pablo Ram�rez,

Your solution worked for me..
I agree. Here's the link:
subject: error with hibernate3 and spring
It's not a secret anymore!