Salut a vous tous
je débute le développement sous eclipse avec Hibernate et je rencontre un problème d'exécution de mon programme

Ma configuation :
- La SDK Eclipse (3.2.0)
- Hibernate3
- Tomcat 5.5

Mon fichier hibernate.cfg.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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
    PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
 
<hibernate-configuration>
    <session-factory >
	<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:XE</property>
	<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
	<property name="hibernate.connection.username">mnauleau</property>
	<property name="hibernate.connection.password">matech</property>
        <property name="dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="hibernate.show_sql">true</property>
        <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
 
        <mapping resource="com/dmpi/Administrateur.hbm.xml"/>
    </session-factory>
</hibernate-configuration>
Mon fichier Administrateur.hbm.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
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
<hibernate-mapping>
	<class name="com.dmpi.hibernate.Administrateur" table="ADMINISTRATEUR">
		 <id name="login" type="string">
            <column name="LOGIN" sql-type="VARCHAR2(50)" not-null="true"/>
        </id>
        <property name="password" type="string">
            <column name="PASSWORD" sql-type="VARCHAR2(50)" not-null="true"/>
        </property>
 
        <property name="nom" type="string">
            <column name="NOM" sql-type="VARCHAR2(50)" not-null="true"/>
        </property>
 
        <property name="prenom" type="string">
            <column name="PRENOM" sql-type="VARCHAR2(50)" not-null="true"/>
        </property>
	</class>
</hibernate-mapping>
Et le test de connexion d'une classe Java
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
Session session = null;
	try {
		SessionFactory factory = new Configuration().configure().buildSessionFactory();
		session = factory.openSession();
		Administrateur admin = new Administrateur("toto");
		session.save(admin);
		session.getTransaction().commit();
	}catch (Exception e) {
		System.out.println(e.getMessage());
	}finally {
		session.close();
	}
Et voivi le contenu de ma console
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
15 mars 2007 22:03:50 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.2
15 mars 2007 22:03:50 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
15 mars 2007 22:03:50 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
15 mars 2007 22:03:50 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
15 mars 2007 22:03:50 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
15 mars 2007 22:03:50 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
15 mars 2007 22:03:51 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : com/dmpi/Administrateur.hbm.xml
15 mars 2007 22:03:51 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: com.dmpi.hibernate.Administrateur -> ADMINISTRATEUR
15 mars 2007 22:03:51 org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
15 mars 2007 22:03:51 org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
15 mars 2007 22:03:51 org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
15 mars 2007 22:03:51 org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
15 mars 2007 22:03:51 org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@localhost:1521:XE
15 mars 2007 22:03:51 org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=mnauleau, password=****}
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: Oracle, version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: Oracle JDBC driver, version: 10.2.0.1.0
15 mars 2007 22:03:53 org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.OracleDialect
15 mars 2007 22:03:53 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
15 mars 2007 22:03:53 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
15 mars 2007 22:03:53 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
15 mars 2007 22:03:53 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
15 mars 2007 22:03:53 org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
15 mars 2007 22:33:43 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: "Servlet.service()" pour la servlet Connexion a généré une exception
java.lang.NullPointerException
	at com.dmpi.servlet.Connexion.doPost(Connexion.java:47)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Unknown Source)
Il n'affiche donc aucune erreur mais lorsqu'il passe dans ma classe ifl tente d'exécuter la commande SessionFactory factory = new Configuration().configure().buildSessionFactory(); mais il passe ensuite directement sur le finally (j'ai fait les tests en mode pas à pas)

Je ne vois pas où est le problème (je précise que j'ai cherché sur les forums et sur l'ensemble des ressources mis à notre disposition)

Pouvez-vous m'aider ?