Bonjour,
j'ai bien déclaré toutes les classes dans hibernate.cfg.xml, et pourtant, j'ai cette erreur:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
org.hibernate.MappingException: entity class not found: Utilisateur
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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
 
	<session-factory>
 
		<!-- Database connection settings -->
		<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
		<property name="connection.password"></property>
		<property name="connection.url">jdbc:mysql://127.0.0.1/tipi_v2</property>
		<property name="connection.username">root</property>
		<!-- SQL dialect -->
		<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
 
		<!-- Disable the second-level cache -->
		<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
		<property name="current_session_context_class">thread</property>
 
		<!-- configuration pool via c3p0--> 
		<property name="c3p0.acquire_increment">1</property> 
		<property name="c3p0.idle_test_period">100</property> <!-- seconds --> 
		<property name="c3p0.max_size">100</property> 
		<property name="c3p0.max_statements">0</property> 
		<property name="c3p0.min_size">10</property> 
		<property name="c3p0.timeout">100</property> <!-- seconds --> 
		<!-- DEPRECATED very expensive property name="c3p0.validate>-->
 
		<!-- Echo all executed SQL to stdout -->
		<property name="show_sql">true</property>
		<mapping resource="org/hibernate/tutorial/domain/Utilisateur.hbm.xml"/>
		<mapping resource="org/hibernate/tutorial/domain/Droit.hbm.xml"/>
		<mapping resource="org/hibernate/tutorial/domain/DroitGroupe.hbm.xml"/>
		<mapping resource="org/hibernate/tutorial/domain/Profil.hbm.xml"/>
		<mapping resource="org/hibernate/tutorial/domain/Societe.hbm.xml"/>
	</session-factory>
 
</hibernate-configuration>

Utilisateur.java :

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
package org.hibernate.tutorial.domain;
// Generated 29 avr. 2011 14:20:29 by Hibernate Tools 3.4.0.CR1
 
import java.util.HashSet;
import java.util.Set;
 
/**
 * Utilisateur generated by hbm2java
 */
public class Utilisateur implements java.io.Serializable {
 
	/**
         * 
         */
	private static final long serialVersionUID = 1L;
	private int idUtilisateur;
	private Societe societe;
	private Profil profil;
	private String login;
	private String password;
	private Set<?> droits = new HashSet<Object>(0);
 
	public Utilisateur() {
	}
 
	public Utilisateur(int idUtilisateur, Societe societe, Profil profil) {
		this.idUtilisateur = idUtilisateur;
		this.societe = societe;
		this.profil = profil;
	}
 
	public Utilisateur(int idUtilisateur, Societe societe, Profil profil, String login, String password, Set<?> droits) {
		this.idUtilisateur = idUtilisateur;
		this.societe = societe;
		this.profil = profil;
		this.login = login;
		this.password = password;
		this.droits = droits;
	}
 
	public int getIdUtilisateur() {
		return this.idUtilisateur;
	}
 
	public void setIdUtilisateur(int idUtilisateur) {
		this.idUtilisateur = idUtilisateur;
	}
 
	public Societe getSociete() {
		return this.societe;
	}
 
	public void setSociete(Societe societe) {
		this.societe = societe;
	}
 
	public Profil getProfil() {
		return this.profil;
	}
 
	public void setProfil(Profil profil) {
		this.profil = profil;
	}
 
	public String getLogin() {
		return this.login;
	}
 
	public void setLogin(String login) {
		this.login = login;
	}
 
	public String getPassword() {
		return this.password;
	}
 
	public void setPassword(String password) {
		this.password = password;
	}
 
	public Set<?> getDroits() {
		return this.droits;
	}
 
	public void setDroits(Set<?> droits) {
		this.droits = droits;
	}
 
}
Utilisateur.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
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 29 avr. 2011 14:20:29 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
    <class name="Utilisateur" table="utilisateur" catalog="tipi_v2">
        <id name="idUtilisateur" type="int">
            <column name="ID_UTILISATEUR" />
            <generator class="assigned" />
        </id>
        <many-to-one name="societe" class="Societe" fetch="select">
            <column name="ID_STE" not-null="true" />
        </many-to-one>
        <many-to-one name="profil" class="Profil" fetch="select">
            <column name="ID_PROFIL" not-null="true" />
        </many-to-one>
        <property name="login" type="string">
            <column name="LOGIN" />
        </property>
        <property name="password" type="string">
            <column name="PASSWORD" />
        </property>
        <set name="droits" table="droit_utilisateur" inverse="true" lazy="true" fetch="select">
            <key>
                <column name="ID_UTILISATEUR" not-null="true" />
            </key>
            <many-to-many entity-name="Droit">
                <column name="ID_DROIT" not-null="true" />
            </many-to-many>
        </set>
    </class>
</hibernate-mapping>
Merci beaucoup à celui qui pourrais m'aider !