IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Hibernate Java Discussion :

Probleme Hibernate : incompatible versions


Sujet :

Hibernate Java

  1. #1
    Membre confirmé
    Profil pro
    Étudiant
    Inscrit en
    Juillet 2009
    Messages
    121
    Détails du profil
    Informations personnelles :
    Âge : 36
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juillet 2009
    Messages : 121
    Par défaut Probleme Hibernate : incompatible versions
    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 :
    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>
    Mais lorsque je lance ma classe de Test j'obtiens l'erreur suivante :
    SLF4J: 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
    J'ai lu sur http://www.slf4j.org/codes.html#version_mismatch qu'il fallait
    "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 ?

  2. #2
    Membre éprouvé
    Profil pro
    Inscrit en
    Février 2007
    Messages
    140
    Détails du profil
    Informations personnelles :
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations forums :
    Inscription : Février 2007
    Messages : 140
    Par défaut
    Bonjour,

    L'erreur est bien claire et tu l'as bien signalée :
    EDIT : on remarque un Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
    Met ton fichier "hibernate.cfg.xml" à la racine de tes ressources JAVA (src).

Discussions similaires

  1. Probleme Hibernate 3 + MySQL 4.1.2
    Par herbert dans le forum SQL Procédural
    Réponses: 7
    Dernier message: 10/07/2007, 12h01
  2. [Forms]Probleme de Nouvelle version de Forms
    Par lido dans le forum Forms
    Réponses: 1
    Dernier message: 09/10/2006, 18h06
  3. Probleme Hibernate 3 + MySQL 4.1.2
    Par herbert dans le forum Hibernate
    Réponses: 5
    Dernier message: 05/09/2006, 03h36
  4. probleme migration base version 6.5 vers 2004
    Par le_gueux dans le forum 4D
    Réponses: 2
    Dernier message: 30/05/2006, 13h29
  5. [LG]Problême "types incompatibles"
    Par pierrOPSG dans le forum Langage
    Réponses: 7
    Dernier message: 23/04/2004, 21h34

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo