Bonjour,

J'ai rechercher une reponse a mon probleme sur plusieurs forums ainsi que sur ce site sans pour autant trouver de reponses.

J'explique donc mon probleme:

J'ai suivi le tutorial pour debutant nous disant comment utiliser hibernate a l'adresse : http://defaut.developpez.com/tutorie...pse/hibernate/

Tout se passe sans probleme jusqu'a que je commence a tester les insertions.

En effet d'apres l'erreur generée il semble qu'eclise ne parviens pas a lire le fichier de config d'hibernate.

Pourtant il est bien present dans le projet conformement au tutorial.

Voici mon fichier de config:

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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
    PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
 
<hibernate-configuration>
    <session-factory >
 
		<!-- local connection properties -->
		<property name="hibernate.connection.url">jdbc:mysql://localhost/base1</property>
		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
		<property name="hibernate.connection.username">user1</property>
		<property name="hibernate.connection.password">password</property>
		<!-- property name="hibernate.connection.pool_size"></property -->
 
		<!-- dialect for MySQL -->
        <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
 
        <property name="hibernate.show_sql">false</property>
        <property name="hibernate.use_outer_join">true</property>
        <!-- <property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
        <property name="jta.UserTransaction">java:comp/UserTransaction</property> -->
 
<property name="hibernate.transaction.factory_class">
   net.sf.hibernate.transaction.JDBCTransactionFactory
</property>
    </session-factory>
</hibernate-configuration>
Et voici l'erreur generée:

ATTENTION: /hibernate.cfg.xml not found
Exception in thread "main" java.lang.ExceptionInInitializerError
at Test.main(Test.java:12)
Caused by: java.lang.RuntimeException: Problème de configuration : /hibernate.cfg.xml not found
at com.minosis.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:16)
... 1 more
Caused by: net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found
at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:872)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:896)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at com.minosis.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:14)
... 1 more

Suite a ce probleme je ne peux plus avancer dans la creation de mon application.

Je vous remercie d'avance pour votre aide , a bientot.