slt tout le monde, 
voila j'ai un petit problème, j'ai réalisé une application qui utilise hibernate, mais je n'arrive pas à l'exécuter, j'ai tjrs cette erreur. 
j'utilise NtBeans 6.5 
Quote:
Exception in thread "main" java.lang.ExceptionInInitializerError 
        at com.test.rsyncModel.HibernateUtil.<clinit>(HibernateUtil.java:30) 
        at com.test.rsyncModel.EventManager.getPersonne(EventManager.java:29) 
        at com.test.rsyncModel.EventManager.main(EventManager.java:20) 
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V 
        at net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47) 
        at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30) 
        at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24) 
        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216) 
        at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144) 
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116) 
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) 
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) 
        at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69) 
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:117) 
        at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:43) 
        at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) 
        at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:135) 
        at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55) 
        at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56) 
        at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295) 
        at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434) 
        at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109) 
        at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55) 
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226) 
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) 
        at com.test.rsyncModel.HibernateUtil.<clinit>(HibernateUtil.java:25)
 
ma classe Personne 
Code:
/* 
* To change this template, choose Tools | Templates 
* and open the template in the editor. 
*/
package com.test.rsyncBean;
import com.test.*;
/** 
* 
* @author zenadm 
*/
public class Personne {
    private String idPersonne;
    private String perIdPersonne;
    private String nom;
    private String prenom;
    private String email;
    private String tel;
    private Compte compte;
   
    public Personne(){
     
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getNom() {
        return nom;
    }
    public void setNom(String nom) {
        this.nom = nom;
    }
    public String getPrenom() {
        return prenom;
    }
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }
    public Compte getCompte() {
        return compte;
    }
    public void setCompte(Compte compte) {
        this.compte = compte;
    }
}
 
:
mon fichier mapping hibernate 
Code:
Code :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> 
<hibernate-mapping>
  <class name="com.test.rsyncBean.Personne" table="personne">
    <id column="ID_PERSONNE" name="idPersonne" type="int">
      <generator class="native"/>
    </id>
    <property column="PER_ID_PERSONNE" name="perIdPersonne" not-null="true" type="string"/>
    <property column="NOM" name="nom" not-null="true" type="string"/>
    <property column="PRENOM" name="prenom" not-null="true" type="string"/>
    <property column="EMAIL" name="email" not-null="true" type="date"/>
    <property column="TEL" name="tel" not-null="false" type="double"/>
  </class>
</hibernate-mapping>
 
 
puis mon fichier conf 
Code :
<?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>
         <!-- SQL dialect -->
        <property name="hibernate.dialect"> org.hibernate.dialect.MySQLInnoDBDialect</property>
    <!-- Database connection settings -->
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/rsyncdb</property>
        <property name="hibernate.connection.username">dfrsyngggfc</property>
        <property name="hibernate.connection.password">ddzeffggn4yffouff</property>
     <!-- JDBC connection pool (use the built-in) -->
        <property name="hibernate.connection.pool_size">1</property>
        <!-- Echo all executed SQL to stdout -->
        <property name="hibernate.show_sql">true</property>
        <!-- Enable Hibernate's automatic session context management -->
        <property name="hibernate.current_session_context_class">thread</property>
        <!-- Drop and re-create the database schema on startup -->
        <property name="hibernate.hbm2ddl.auto">create</property>
        <mapping resource="com/test/rsyncBean/Personne.hbm.xml"/>
    </session-factory>
</hibernate-configuration>
 
 et pour exécuter tout ça j'utilise le deux classes surventes : 
Code:
/* 
* To change this template, choose Tools | Templates 
* and open the template in the editor. 
*/
package com.test.rsyncModel;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
/** 
* 
* @author zenadm 
*/
//import org.hibernate.*; 
//import org.hibernate.cfg.*; 
public class HibernateUtil {
    private static final SessionFactory sessionFactory;
    static {
        try {
            // Create the SessionFactory from hibernate.cfg.xml 
            sessionFactory = new Configuration().configure().buildSessionFactory();
           
        } catch (Throwable ex) {
            // Make sure you log the exception, as it might be swallowed 
            System.err.println("Initial SessionFactory creation failed." + ex);
            throw new ExceptionInInitializerError(ex);
        }
    }
    public static SessionFactory getSessionFactory() {
        return sessionFactory;
    }
}
 
 enfin ma classe main: 
Code:
/* 
* To change this template, choose Tools | Templates 
* and open the template in the editor. 
*/
package com.test.rsyncModel;
import com.test.rsyncBean.Personne;
import org.hibernate.Session;
public class EventManager {
    public static void main(String[] args) {
        EventManager mgr = new EventManager();
   
            mgr.getPersonne();
            System.out.println(mgr);
       
        HibernateUtil.getSessionFactory().close();
    }
    private String getPersonne() {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        Personne thePersonne = new Personne();
        thePersonne.getNom();
        thePersonne.getPrenom();
        session.save(thePersonne);
        session.getTransaction().commit();
        return thePersonne.getNom()+thePersonne.getPrenom();
    }
}