Probleme de hibernate

Fermé
ensate - 24 janv. 2012 à 08:43
 Utilisateur anonyme - 24 janv. 2012 à 08:53
Bonjour,

je fais une aplication avec hibernate et voila l'ereur qui s'affiche:
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.MappingException: Resource: Personnes.hbm.xml not found
at org.hibernate.cfg.Configuration.addClass(Configuration.java:499)
at TestHibernate1.main(TestHibernate1.java:9)



code de personnes.java
import java.util.Date;

public class Personnes {

private Integer idPersonne;
private String nomPersonne;
private String prenomPersonne;
private Date datenaissPersonne;

public Personnes(String nomPersonne, String prenomPersonne, Date datenaissPersonne) {
this.nomPersonne = nomPersonne;
this.prenomPersonne = prenomPersonne;
this.datenaissPersonne = datenaissPersonne;
}

public Personnes() {
}

public Date getDatenaissPersonne() {
return datenaissPersonne;
}

public Integer getIdPersonne() {
return idPersonne;
}

public String getNomPersonne() {
return nomPersonne;
}

public String getPrenomPersonne() {
return prenomPersonne;
}

public void setDatenaissPersonne(Date date) {
datenaissPersonne = date;
}

public void setIdPersonne(Integer integer) {
idPersonne = integer;
}

public void setNomPersonne(String string) {
nomPersonne = string;
}

public void setPrenomPersonne(String string) {
prenomPersonne = string;
}

}


hibernate.cfg. xml


<?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:oracle:thin:@localhost:1521:xe
</property>
<property name="hibernate.connection.driver_class">
oracle.jdbc.OracleDriver
</property>
<property name="hibernate.connection.username">ensa</property>
<property name="hibernate.connection.password">ikan</property>
<!-- property name="hibernate.connection.pool_size"></property -->
<!-- dialect for Oracle (any version) -->
<property name="dialect">
net.sf.hibernate.dialect.OracleDialect
</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>
<mapping resource="Personnes.hbm.xml" />
</session-factory>
</hibernate-configuration>

presonnes.hbm


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="com.minosis.hibernate">
<class name="Personnes" table="PERSONNES">
<id
column="IDPERSONNE"
name="Idpersonne"
type="integer"
>
<generator class="vm" />
</id>
<property
column="PRENOMPERSONNE"
length="50"
name="Prenompersonne"
not-null="false"
type="string"
/>
<property
column="DATENAISSPERSONNE"
length="7"
name="Datenaisspersonne"
not-null="false"
type="date"
/>
<property
column="NOMPERSONNE"
length="50"
name="Nompersonne"
not-null="false"
type="string"
/>
</class>
</hibernate-mapping>


merci de m'aider a resoudre ce probleme

1 réponse

Utilisateur anonyme
24 janv. 2012 à 08:53
toi aussi tu doit être en hibernation pour avoir posé la question dans la section vidéo numérique !!

redirige sur programmation
0