-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: spring+hibernate+junit error
PostPosted: Thu Jun 15, 2006 11:59 pm 
Newbie

Joined: Thu Jun 15, 2006 11:56 pm
Posts: 1
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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 16, 2006 3:24 am 
Beginner
Beginner

Joined: Wed Aug 27, 2003 3:54 am
Posts: 28
I assume this is a problem in the code of PersonDaoTest.java.
- Could you show the code you have written at com.pst.lms.dao.junit.PersonDaoTest.<init>(PersonD aoTest.java:73) ?
- Could you include the applicationContext.xml that you are using ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.