salut les membres
je viens de debuter avec Spring et j'arrive pas à cohabiter Spring et Hibernate. voila mon fichier de configuration config.xml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
	<property name="driverClassName">
		<value>oracle.jdbc.OracleDriver</value>
	</property>
	<property name="url">
		<value>jdbc:oracle:thin:@srv_data:1521:labdb</value>
	</property>
	<property name="username">
		<value>saeb</value>
	</property>
	<property name="password">
		<value>saeb</value>
	</property>
</bean>
<bean id="sessionFactoryBean" 
class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
	<property name="dataSource">
		<ref bean="dataSource" />
	</property>
	<property name="hibernateProperties">
		<props>
			<prop key="hibernate.dialect">
			org.hibernate.dialect.Oracle9Dialect
			</prop>
			<prop key="hibernate.show_sql">false</prop>
			<prop key="hibernate.use_outer_join">true</prop>
		</props>
	</property>
	<property name="mappingResources">
		<list>
			<value>xxx/model/Client.hbm.xml</value>
			<value>xxx/model/Operation.hbm.xml</value>
		</list>
	</property>		
</bean>
<bean id="basicDataDao" class="xxx.integration.ClientData">
	<property name="sessionFactory">
		<ref bean="sessionFactoryBean" />
	</property>
</bean>
Au moment ou je veux me servir des methodes "getHibernateTemplate()" ou "getSessionFactory()" j'obtiens tjs la fameuse "NULL" (on dirait que mon fichier n'est pas deployé).

Plus que ça, lorsque j'execute"
sessionFactory=(SessionFactory) factory.getBean("sessionFactoryBean");"
j'obtien l'erreur ci-dessous malgré que toutes mes librairies sont ajoutées au projet (spring.jar, hibernate3.jar, spring-hibernate.jar, spring-dao.jar....):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryBean' defined in class path resource [config.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
si quelq'un peut m'aider, je serais trés reconnaissant.
THINKS