Hi,
When i tried to run the test case for the DAO (springs+hibernate), getting the below error
--------------------------------------------------------------
junit.framework.AssertionFailedError: Exception in constructor: testFindByUsernamePassword (org.springframework.beans.factory.BeanCreationExc eption: Error creating bean with name 'sessionFactory' defined in class path resource [.\applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: null
java.lang.NoClassDefFoundError
at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1055)
at org.springframework.orm.hibernate3.LocalSessionFac toryBean.newSessionFactory(LocalSessionFactoryBean .java:777)
at org.springframework.orm.hibernate3.LocalSessionFac toryBean.afterPropertiesSet(LocalSessionFactoryBea n.java:703)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:318)
at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:81)
at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:66)
at com.pst.lms.dao.junit.PersonDaoTest.<init>(PersonD aoTest.java:73)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
)
I am using hibernate3, and placed all spring, hibernate, echocache jars in the class path.
Please help me in this regards.
Thanks in advance.
Regards
Kris
|