PDA

View Full Version : Strange problem finding library (hibernate template)


sore
Feb 10th, 2006, 07:31 PM
I have configured a hibernateTemplate in my -servlet.xml file.


<bean id="hibernateTemplate" class="org.springframework.orm.hibernate.HibernateTemplat e">
<property name="sessionFactory">
<ref local="mySessionFactory"/>
</property>
</bean>


I found a Spring jar with the hibernateTemplate in it, but I now get the error

Error registering bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/sting-servlet.xml]: Class that bean class [org.springframework.orm.hibernate.HibernateTemplat e] depends on not found; nested exception is java.lang.NoClassDefFoundError:

I have checked the application in tomcat, and it does have the spring.jar with the class HibernateTemplate in the lib folder.

Anyone have any ideas?

Steve O
Feb 10th, 2006, 10:58 PM
I'm not sure what version of Spring you are using, but I believe that for 2.0 you need to include the dist/extmodules/spring-hibernate2.jar (for version 2 of hibernate).

Steve

sore
Feb 11th, 2006, 05:54 AM
Thanks that solved it! Problem was I had to use Hibernate3 library. And that wasn't in my spring release.