Bonjour
J'ai l'erreur suivante avec mon hibernate :
Pourtant, j'ai bien un fichier Utilisateur.hbm.xml dans le package org.schwartz.cydonia.data avec :
Code : Sélectionner tout - Visualiser dans une fenêtre à part Unable to construct service services.SessionCreator: Unable to instantiate instance of class org.schwartz.cydonia.data.implementations.DefaultSessionCreator: Resource: org.schwartz.cydonia.data/Utilisateur.hbm.xml not found
et mon fichier de config hibernate.cfg.xml, à la racine de mon Java Source, est :
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 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="org.schwartz.cydonia.data.Utilisateur" table="utilisateurs"> <id name="id" column="id_utilisateurs"> <generator class="seqhilo"> <param name="sequence">hi_value</param> <param name="max_lo">100</param> </generator> </id> <property name="login" unique="true" not-null="true"/> <property name="nomCmd" unique="true" not-null="true"/> <property name="password" not-null="true" /> <property name="mail" unique="true" not-null="true"/> <property name="dateInscription" type="date"/> <property name="dateLastLog" type="date"/> </class> </hibernate-mapping>
Pour info, je lance la configuration d'hibernate ainsi :
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 <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <!-- a SessionFactory instance listed as /jndi/name --> <session-factory> <!-- properties --> <property name="connection.datasource">java:comp/env/jdbc/cydoniaDataSource</property> <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property> <property name="show_sql">true</property> <property name="hbm2ddl.auto">update</property> <property name="connection.isolation"> value="8" </property> <property name="connection.autocommit"> value="false" </property> <!-- mapping files --> <mapping resource="org.schwartz.cydonia.data/Utilisateur.hbm.xml"/> </session-factory> </hibernate-configuration>
Vous avez des pistes ??? Je sèche là dessus depuis quelques temps déjà et je commence à péter un plomb
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 public class DefaultSessionCreator implements SessionCreator { private SessionFactory sessionFactory; public DefaultSessionCreator() { // cfg.addClass(Utilisateur.class); sessionFactory = new Configuration().configure().buildSessionFactory(); } public Session createSession() { return sessionFactory.openSession(); } }.
Merci d'avance
ZedroS
Partager