This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "error with hibernate3 and spring" Watch "error with hibernate3 and spring" New topic
Author

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?
thanks
<code>
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 [org.springframework.beans.factory.support.DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfigurer,dataSource,sessionFactory,transactionManager]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory 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(Class.java:1610)
at java.lang.Class.getConstructor0(Class.java:1922)
at java.lang.Class.newInstance0(Class.java:278)
at java.lang.Class.newInstance(Class.java:261)
at org.hibernate.cfg.SettingsFactory.createCacheProvider(SettingsFactory.java:323)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:219)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1004)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:800)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:726)
</code>


--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
Greenhorn

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..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: error with hibernate3 and spring