aspose file tools*
The moose likes Other Application Frameworks and the fly likes bean binding error 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 "bean binding error" Watch "bean binding error" New topic

bean binding error

saravana kumar
Ranch Hand

Joined: Jun 25, 2002
Posts: 72
Hi All ,

i am getting the following error when binding a bean with another one.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXDAO' defined in class path resource [com/xxxxxxxxxxx/xxxx/dataaccess/yyyyyyy/yyyyHibernateAppContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/SessionFactory
java.lang.NoClassDefFoundError: net/sf/hibernate/SessionFactory
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(
at java.lang.Class.getDeclaredMethods(
at java.beans.Introspector$
at Method)
at java.beans.Introspector.getPublicDeclaredMethods(
at java.beans.Introspector.getTargetMethodInfo(
at java.beans.Introspector.getBeanInfo(
at java.beans.Introspector.getBeanInfo(
at java.beans.Introspector.getBeanInfo(
at java.beans.Introspector.<init>(
at java.beans.Introspector.getBeanInfo(
at org.springframework.beans.CachedIntrospectionResults.<init>(
at org.springframework.beans.CachedIntrospectionResults.forClass(
at org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(
at org.springframework.beans.BeanWrapperImpl.<init>(
at org.springframework.test.AbstractSpringContextTests.loadContextLocations(
at org.springframework.test.AbstractDependencyInjectionSpringContextTests.loadContextLocations(
at org.springframework.test.AbstractSpringContextTests.getContext(
at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(
at junit.framework.TestCase.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at junit.framework.TestSuite.runTest(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

here is the declaration
<bean id="xxxxxxDAO" class="com.xxxxxxxx.xxxx.dataaccess.yyyyyyy.XXXXXDAO">
<property name="sessionFactory"><ref local="sessionFactory"/></property>

please guide me how to solve this issue. source and class file are in the same project.
Stu Thompson
Ranch Hand

Joined: Jun 14, 2006
Posts: 136
You'll need to show us your sessionFactory bean definition too.

"This is not to say that design is unnecessary. But after a certain point, design is just speculation." --Philip Chu
Jason Menard

Joined: Nov 09, 2000
Posts: 6450
Without having all the information, here are a couple of guesses... Check that the hibernate jar is in the classpath or possibly you are using one of the newer versions of hibernate and should be referencing org.hibernate.SessionFactory as opposed to net.sf.hibernate.SessionFactory
jQuery in Action, 2nd edition
subject: bean binding error