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

Frameworks Web Java Discussion :

Hibernate: erreur SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".


Sujet :

Frameworks Web Java

  1. #1
    Membre à l'essai
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2013
    Messages
    25
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Laos

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juillet 2013
    Messages : 25
    Points : 23
    Points
    23
    Par défaut Hibernate: erreur SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    je développe une application avec maven et hibernate. Or, 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
    22
    23
    24
    25
    26
    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
    Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
    Exception in thread "main" java.lang.ExceptionInInitializerError
    	at Util.HibernateUtil.<clinit>(HibernateUtil.java:18)
    	at Dao.Service.addProduit(Service.java:9)
    	at Util.Test.main(Test.java:20)
    Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
    	at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
    	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
    	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
    	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
    	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
    	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
    	at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
    	at Util.HibernateUtil.<clinit>(HibernateUtil.java:14)
    	... 2 more
    Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	... 10 more
    ci joint les deux classes, leurs fichiers hbm.xml respectivement, la classe service, le fichier HibernateUtil, Hibernate.cfg.xml ainsi que le POM.xml et enfin une classe de teste
    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
    package Dao;
     
    import java.util.Date;
    import java.util.HashSet;
    import java.util.Set;
     
    public class Categorie {
    	private Long idCategorie;
    	private String titre;
    	private String Description;
    	private Date dateAjout;
    	private Set<Produit> produits = new HashSet<Produit>();
     
     
    	public Set<Produit> getProduits() {
    		return produits;
    	}
    	public void setProduits(Set<Produit> produits) {
    		this.produits = produits;
    	}
    	public Categorie() {
    		super();
    		// TODO Auto-generated constructor stub
    	}
    	public Categorie(String titre, String description, Date dateAjout) {
    		super();
    		this.titre = titre;
    		Description = description;
    		this.dateAjout = dateAjout;
    	}
    	public Long getIdCategorie() {
    		return idCategorie;
    	}
    	public void setIdCategorie(Long idCategorie) {
    		this.idCategorie = idCategorie;
    	}
    	public String getTitre() {
    		return titre;
    	}
    	public void setTitre(String titre) {
    		this.titre = titre;
    	}
    	public String getDescription() {
    		return Description;
    	}
    	public void setDescription(String description) {
    		Description = description;
    	}
    	public Date getDateAjout() {
    		return dateAjout;
    	}
    	public void setDateAjout(Date dateAjout) {
    		this.dateAjout = dateAjout;
    	}
     
     
     
    }
    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
    package Dao;
     
    public class Produit {
     
    	private Long idProduit;
    	private String Nom;
    	private String description;
    	private Double prix;
     
     
    	public Produit(String nom, String description, Double prix) {
    		super();
    		Nom = nom;
    		this.description = description;
    		this.prix = prix;
    	}
    	public Produit() {
    		super();
    		// TODO Auto-generated constructor stub
    	}
    	public Long getIdProduit() {
    		return idProduit;
    	}
    	public void setIdProduit(Long idProduit) {
    		this.idProduit = idProduit;
    	}
    	public String getNom() {
    		return Nom;
    	}
    	public void setNom(String nom) {
    		Nom = nom;
    	}
    	public String getDescription() {
    		return description;
    	}
    	public void setDescription(String description) {
    		this.description = description;
    	}
    	public Double getPrix() {
    		return prix;
    	}
    	public void setPrix(Double prix) {
    		this.prix = prix;
    	}
     
     
     
    }
    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
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
     
    <hibernate-mapping>
     
    <class name="Dao.Categorie" table="CATEGORIE">
     
    	<id name="idCategorie" column="ID_CATEGORIE">
    		<generator class="native"></generator>
    	</id>
     
    	<property name="titre" column="TITRE"></property>
    	<property name="description" column="DESCRPTION"></property>
    	<property name="dateAjout" column="DATE_AJOUT"></property>
     
    	<set name="produits" table="CAT_PROD">
    		<key column="ID_CATEGORIE"> </key>
    		<many-to-many class="Dao.Produit" column="ID_PRODUIT"></many-to-many>
    	</set>
    </class>
     
    </hibernate-mapping>
    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
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
     
    <hibernate-mapping>
     
    <class name="Dao.Produit" table="PRODUITS">
     
    	<id name="idProduit" column="ID_PRODUIT">
    		<generator class="native"></generator>
    	</id>
     
    	<property name="nom" column="NOM"></property>
    	<property name="description" column="DESCRPTION"></property>
    	<property name="prix" column="PRIX"></property>
    </class>
     
    </hibernate-mapping>
    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
    package Dao;
    import org.hibernate.Session;
     
    import Util.HibernateUtil;
     
    public class Service {
     
    	public void addProduit(Produit p){
    		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    		session.beginTransaction();
    		session.save(p);
    		session.getTransaction().commit();
    	}
     
    }
    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
    package Util;
     
    import org.hibernate.*;
    import org.hibernate.cfg.*;
     
     
     
    public class HibernateUtil {
        public static final SessionFactory sessionFactory;
     
        static {
            try {
                // Création de la sessionFactory Ã* partir de(hibernate.cfg.xml) 
                sessionFactory =  new Configuration().configure().buildSessionFactory();
            } catch (Throwable ex) {
                // Log the exception. 
                System.err.println("Initial SessionFactory creation failed." + ex);
                throw new ExceptionInInitializerError(ex);
            }
        }
     
        public static SessionFactory getSessionFactory() {
            return sessionFactory;
        }
    }
    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
    package Util;
     
    import org.hibernate.Session;
     
    import Dao.Produit;
    import Dao.Service;
     
    public class Test {
     
    	/**
             * @param args
             */
    	public static void main(String[] args) {
    		// TODO Auto-generated method stub
     
     
     
    		Service s = new Service();
    		Produit p = new Produit("pc", "sony",(double) 7000);
    		s.addProduit(p);
    	}
     
    }
    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://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    <hibernate-configuration>
      <session-factory>
     
     
     
        <!-- Database connection settings -->
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/gestprod</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password"></property>
     
        <!-- JDBC connection pool -->
        <property name="connection.pool.size">1</property>
     
        <!-- SQL dialect -->
        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
     
        <!-- Enable Hibernate's automatic session context management -->
        <property name="hibernate.current_session_context_class">thread</property>
     
     
        <!-- Disable the second-level cache -->
        <property name="cache.provider_class">org.Hibenate.cache.NoCacheProvider</property>
     
        <!-- Echo all executed SQL to sdout -->
        <property name="hibernate.show_sql">true</property>
     
    	<!-- Drop and re-create the database shema on startup --> 
    	<property name="hbm2dll.auto">create</property>
     
    	<mapping resource="dao/Categorie.hbm.xml"/>
    	<mapping resource="dao/Produit.hbm.xml"/>   
     
     
     
      </session-factory>
    </hibernate-configuration>
    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
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    	<modelVersion>4.0.0</modelVersion>
    	<groupId>jpa</groupId>
    	<artifactId>jpa</artifactId>
    	<version>0.0.1-SNAPSHOT</version>
    	<build>
    		<sourceDirectory>src</sourceDirectory>
    		<plugins>
    			<plugin>
    				<artifactId>maven-compiler-plugin</artifactId>
    				<version>2.3.2</version>
    				<configuration>
    					<source>1.7</source>
    					<target>1.7</target>
    				</configuration>
    			</plugin>
    		</plugins>
    	</build>
    	<dependencies>
    		<dependency>
    			<groupId>mysql</groupId>
    			<artifactId>mysql-connector-java</artifactId>
    			<version>5.1.6</version>
    		</dependency>
    		<dependency>
    			<groupId>org.hibernate</groupId>
    			<artifactId>hibernate-core</artifactId>
    			<version>3.5.6-Final</version>
    		</dependency>
     
     
     
     
    	</dependencies>
     
    </project>
    Quelqu'un aurait une idée ? merci d'avance !

  2. #2
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    salut,
    ajoutes cette dependance:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.6</version>
    </dependency>
    eric

  3. #3
    Membre à l'essai
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2013
    Messages
    25
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Laos

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juillet 2013
    Messages : 25
    Points : 23
    Points
    23
    Par défaut
    Merci pour votre réponse! cependant ça génère une autre erreur !
    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
    log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
    log4j:WARN Please initialize the log4j system properly.
    Initial SessionFactory creation failed.org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]
    Exception in thread "main" java.lang.ExceptionInInitializerError
    	at Util.HibernateUtil.<clinit>(HibernateUtil.java:18)
    	at Dao.Service.addProduit(Service.java:9)
    	at Util.Test.main(Test.java:20)
    Caused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]
    	at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:402)
    	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:270)
    	at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
    	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
    	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
    	at Util.HibernateUtil.<clinit>(HibernateUtil.java:14)
    	... 2 more
    Caused by: java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    	at java.lang.reflect.Constructor.newInstance(Unknown Source)
    	at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:397)
    	... 7 more
    Caused by: org.hibernate.cache.CacheException: could not instantiate CacheProvider [org.Hibenate.cache.NoCacheProvider]
    	at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:66)
    	... 12 more
    Caused by: java.lang.ClassNotFoundException: org.Hibenate.cache.NoCacheProvider
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
    	at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)
    	... 12 more

  4. #4
    Membre à l'essai
    Femme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2013
    Messages
    25
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Laos

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juillet 2013
    Messages : 25
    Points : 23
    Points
    23
    Par défaut
    j'ai pu régler le problème, voici la nouvelle erreur

    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
    16:49:12,792  INFO Environment:570 - Hibernate 3.5.6-Final
    16:49:12,796  INFO Environment:603 - hibernate.properties not found
    16:49:12,799  INFO Environment:781 - Bytecode provider name : javassist
    16:49:12,807  INFO Environment:662 - using JDK 1.4 java.sql.Timestamp handling
    16:49:12,946  INFO Configuration:1518 - configuring from resource: /hibernate.cfg.xml
    16:49:12,946  INFO Configuration:1495 - Configuration resource: /hibernate.cfg.xml
    16:49:13,020  INFO Configuration:655 - Reading mappings from resource : dao/Categorie.hbm.xml
    16:49:13,073  INFO HbmBinder:348 - Mapping class: Dao.Categorie -> CATEGORIE
    16:49:13,092  INFO HbmBinder:1487 - Mapping collection: Dao.Categorie.produits -> CAT_PROD
    16:49:13,093  INFO Configuration:655 - Reading mappings from resource : dao/Produit.hbm.xml
    16:49:13,108  INFO HbmBinder:348 - Mapping class: Dao.Produit -> PRODUITS
    16:49:13,108  INFO Configuration:1633 - Configured SessionFactory: null
    16:49:13,166  INFO DriverManagerConnectionProvider:64 - Using Hibernate built-in connection pool (not for production use!)
    16:49:13,166  INFO DriverManagerConnectionProvider:65 - Hibernate connection pool size: 20
    16:49:13,166  INFO DriverManagerConnectionProvider:68 - autocommit mode: false
    16:49:13,175  INFO DriverManagerConnectionProvider:103 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/gestprod
    16:49:13,176  INFO DriverManagerConnectionProvider:109 - connection properties: {user=root, password=****, pool.size=1}
    16:49:13,388  INFO SettingsFactory:117 - RDBMS: MySQL, version: 5.5.8-log
    16:49:13,388  INFO SettingsFactory:118 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6 ( Revision: ${svn.Revision} )
    16:49:13,409  INFO Dialect:206 - Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
    16:49:13,424  INFO JdbcSupportLoader:79 - Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
    16:49:13,430  INFO TransactionFactoryFactory:59 - Using default transaction strategy (direct JDBC transactions)
    16:49:13,431  INFO TransactionManagerLookupFactory:80 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
    16:49:13,432  INFO SettingsFactory:169 - Automatic flush during beforeCompletion(): disabled
    16:49:13,432  INFO SettingsFactory:173 - Automatic session close at end of transaction: disabled
    16:49:13,432  INFO SettingsFactory:180 - JDBC batch size: 15
    16:49:13,432  INFO SettingsFactory:183 - JDBC batch updates for versioned data: disabled
    16:49:13,433  INFO SettingsFactory:188 - Scrollable result sets: enabled
    16:49:13,433  INFO SettingsFactory:196 - JDBC3 getGeneratedKeys(): enabled
    16:49:13,433  INFO SettingsFactory:204 - Connection release mode: auto
    16:49:13,434  INFO SettingsFactory:228 - Maximum outer join fetch depth: 2
    16:49:13,434  INFO SettingsFactory:231 - Default batch fetch size: 1
    16:49:13,434  INFO SettingsFactory:235 - Generate SQL with comments: disabled
    16:49:13,435  INFO SettingsFactory:239 - Order SQL updates by primary key: disabled
    16:49:13,435  INFO SettingsFactory:243 - Order SQL inserts for batching: disabled
    16:49:13,435  INFO SettingsFactory:410 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    16:49:13,437  INFO ASTQueryTranslatorFactory:47 - Using ASTQueryTranslatorFactory
    16:49:13,437  INFO SettingsFactory:251 - Query language substitutions: {}
    16:49:13,437  INFO SettingsFactory:256 - JPA-QL strict compliance: disabled
    16:49:13,437  INFO SettingsFactory:261 - Second-level cache: enabled
    16:49:13,438  INFO SettingsFactory:265 - Query cache: disabled
    16:49:13,441  INFO SettingsFactory:395 - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
    16:49:13,441  INFO RegionFactoryCacheProviderBridge:61 - Cache provider: org.hibernate.cache.EhCacheProvider
    16:49:13,446  INFO SettingsFactory:275 - Optimize cache for minimal puts: disabled
    16:49:13,446  INFO SettingsFactory:284 - Structured second-level cache entries: disabled
    16:49:13,450  INFO SettingsFactory:304 - Echoing all SQL to stdout
    16:49:13,451  INFO SettingsFactory:313 - Statistics: disabled
    16:49:13,451  INFO SettingsFactory:317 - Deleted entity synthetic identifier rollback: disabled
    16:49:13,451  INFO SettingsFactory:332 - Default entity-mode: pojo
    16:49:13,451  INFO SettingsFactory:336 - Named query checking : enabled
    16:49:13,451  INFO SettingsFactory:340 - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
    16:49:13,479  INFO SessionFactoryImpl:199 - building session factory
    16:49:13,517 DEBUG CacheManager:553 - Configuring ehcache from classpath.
    16:49:13,524  WARN ConfigurationFactory:134 - No configuration found. Configuring ehcache from ehcache-failsafe.xml  found in the classpath: jar:file:/C:/Users/azerty/.m2/repository/net/sf/ehcache/ehcache-core/2.4.3/ehcache-core-2.4.3.jar!/ehcache-failsafe.xml
    16:49:13,524 DEBUG ConfigurationFactory:96 - Configuring ehcache from URL: jar:file:/C:/Users/azerty/.m2/repository/net/sf/ehcache/ehcache-core/2.4.3/ehcache-core-2.4.3.jar!/ehcache-failsafe.xml
    16:49:13,525 DEBUG ConfigurationFactory:148 - Configuring ehcache from InputStream
    16:49:13,549 DEBUG BeanHandler:271 - Ignoring ehcache attribute xmlns:xsi
    16:49:13,549 DEBUG BeanHandler:271 - Ignoring ehcache attribute xsi:noNamespaceSchemaLocation
    16:49:13,550 DEBUG DiskStoreConfiguration:118 - Disk Store Path: C:\Users\azerty\AppData\Local\Temp\
    16:49:13,578 DEBUG PropertyUtil:88 - propertiesString is null.
    16:49:13,581 DEBUG ConfigurationHelper:184 - No CacheManagerEventListenerFactory class specified. Skipping...
    16:49:13,627 DEBUG Cache:949 - No BootstrapCacheLoaderFactory class specified. Skipping...
    16:49:13,627 DEBUG Cache:923 - CacheWriter factory not configured. Skipping...
    16:49:13,629 DEBUG ConfigurationHelper:96 - No CacheExceptionHandlerFactory class specified. Skipping...
    16:49:13,799  INFO SessionFactoryObjectFactory:105 - Not binding factory to JNDI, no JNDI name configured
    16:49:13,803  INFO SchemaValidator:121 - Running schema validator
    16:49:13,803  INFO SchemaValidator:129 - fetching database metadata
    16:49:13,806  INFO DatabaseMetadata:119 - table not found: CATEGORIE
    Initial SessionFactory creation failed.org.hibernate.HibernateException: Missing table: CATEGORIE
    Exception in thread "main" java.lang.ExceptionInInitializerError
    	at Util.HibernateUtil.<clinit>(HibernateUtil.java:20)
    	at Dao.Service.addProduit(Service.java:9)
    	at Util.Test.main(Test.java:20)
    Caused by: org.hibernate.HibernateException: Missing table: CATEGORIE
    	at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1171)
    	at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
    	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:389)
    	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
    	at Util.HibernateUtil.<clinit>(HibernateUtil.java:16)
    	... 2 more

  5. #5
    Membre chevronné Avatar de jeffray03
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juillet 2008
    Messages
    1 501
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Allemagne

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Juillet 2008
    Messages : 1 501
    Points : 2 120
    Points
    2 120
    Par défaut
    Salut,
    mets dans ton fichier de configuration ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
      hibernate.validator.apply_to_ddl to false.
      <property name="hibernate.validator.apply_to_ddl">false</property>
    et aussi , verifies bien comment tu as crée tes tables?(Majuscule ou minuscule)

    Eric

Discussions similaires

  1. Réponses: 6
    Dernier message: 25/02/2014, 18h06
  2. Réponses: 0
    Dernier message: 19/03/2013, 05h26
  3. Réponses: 4
    Dernier message: 01/04/2011, 12h14
  4. Réponses: 1
    Dernier message: 04/04/2010, 11h51
  5. [IDE][VS2005] 'The class diagram service failed to load' ?
    Par Landolsi dans le forum EDI/Outils
    Réponses: 1
    Dernier message: 17/01/2006, 09h32

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