Salut,
Je viens de me lancer dans le monde d'Hibernate 3.
Apres avoir lu quelques docs par ci par la, j'ai mis en application tout cela sur un projet mais j'ai un problème lors du lancement de mon test.
Je m'explique... J'ai donc mon hibernate.cfg.xml dans mon WebContent/WEB-INF :
Mais lorsque je lance ma classe de Test j'obtiens l'erreur suivante :
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' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <property name="show_sql">true</property> <!-- config de la session factory pour utiliser MySQL --> <property name="hibernate.connection.username">monUser</property> <property name="hibernate.connection.password">monPass</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/projetcommunautaire</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <!-- fichiers de mapping --> <mapping resource="Utilisateur.hbm.xml"/> </session-factory> </hibernate-configuration>
J'ai lu sur http://www.slf4j.org/codes.html#version_mismatch qu'il fallaitSLF4J: The requested version 1.5.10 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
10 janv. 2010 19:40:22 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.3.2.GA
10 janv. 2010 19:40:22 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
10 janv. 2010 19:40:22 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : javassist
10 janv. 2010 19:40:22 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
10 janv. 2010 19:40:23 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
10 janv. 2010 19:40:23 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at hibernate.TestUtilisateur.main(TestUtilisateur.java:12)
Caused by: java.lang.RuntimeException: Pb de conf : /hibernate.cfg.xml not found
at hibernate.HibernateUtil.<clinit>(HibernateUtil.java:14)
... 1 more
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1453)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1475)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at hibernate.HibernateUtil.<clinit>(HibernateUtil.java:12)
... 1 more
"SLF4J versions 1.4.0 and later requires log4j 1.2.12 or later" mais malheureusement malgré cela l'erreur ne disparait pas...
Quelqu'un a déjà eu ce problème ?
Merci beaucoup
EDIT : on remarque un Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
Serait-ce pas de ce coté la plutot qu'il faudrait chercher ?![]()
Partager