-->
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.  [ 6 posts ] 
Author Message
 Post subject: Hibernate/Spring: net/sf/hibernate/cfg/Configuration CNFE
PostPosted: Thu Jul 28, 2005 6:23 am 
Newbie

Joined: Thu Jul 28, 2005 6:17 am
Posts: 14
Hi,

I get a ClassNotFoundException when i try to do this:
ApplicationContext context = new FileSystemXmlApplicationContext("appContext.xml");

Hibernate version: 3

My appContext.xml contains the following:
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref bean="dataSourceAlone"/></property>
<property name="mappingDirectoryLocations">
<list>
<value>nl.ictu.spg.berichten.LO3</value>
<value>nl.ictu.spg.gegevensmodel.LO3</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.dialect">false</prop>
</props>
</property>
</bean>

<bean id="testDAO" class="nl.ictu.spg.test.hibernate_spring.TestDAOHibernate">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>

TestDAOHibernate extends HibernateDaoSupport

i get the following exception:
Error creating bean with name 'sessionFactory' defined in file [appContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/cfg/Configuration

But i have alle the libs on the classpath and i can't find the Configuration in any of the libs under that package. What am i doing wrong?

Thanks,
Maarten


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:29 am 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
are you sure you have hibernate 2.1 in your classpath, not 3.0?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:34 am 
Newbie

Joined: Thu Jul 28, 2005 6:17 am
Posts: 14
i have the hibernate3.jar in my classpath, including all the libs that come with hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:40 am 
Newbie

Joined: Thu Jul 28, 2005 6:17 am
Posts: 14
i think it has something to do with the spring.jar. We use Hibernate 3.0.5 so i'll try to get the latest Spring version.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:41 am 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
you use hibernate2 spring SessionFactory bean
(org.springframework.orm.hibernate.LocalSessionFactoryBean)
which require hibernate2
if you want to use hibernate3 -- use
org.springframework.orm.hibernate3.LocalSessionFactoryBean


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 6:47 am 
Newbie

Joined: Thu Jul 28, 2005 6:17 am
Posts: 14
Thanks, it worked, i also downloaded the latest version of Spring and put most of the libs in my classpath.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.