facebook

Erreur de creation SessionFactory

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #269090 Reply

    simadou
    Member

    Salut
    j’ai un problème d’ouverture de session, pourtant mon application est bien configuré.
    la class qui contient main genere l’exception suivante:
    %%%% Error Creating SessionFactory %%%%
    org.hibernate.MappingException: entity class not found: TableCompte
    at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:99)
    at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:166)
    at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
    at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:115)
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
    at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
    at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:216)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
    at com.focus.smq.struts.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:63)
    at com.focus.smq.struts.HibernateSessionFactory.getSession(HibernateSessionFactory.java:44)
    at com.focus.smq.BaseHibernateDAO.getSession(BaseHibernateDAO.java:16)
    at com.focus.smq.exemple.TestExemple.main(TestExemple.java:21)
    Caused by: java.lang.ClassNotFoundException: TableCompte
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
    at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:96)
    … 12 more
    Exception in thread “main” java.lang.NullPointerException
    at com.focus.smq.exemple.TestExemple.main(TestExemple.java:21)

    la classe est:
    package com.focus.smq.exemple;

    //import java.util.Iterator;
    //import java.util.List;
    //import org.apache.log4j.Logger;
    import org.hibernate.HibernateException;
    //import org.hibernate.Session;
    import org.hibernate.Transaction;
    //import com.focus.smq.struts.HibernateSessionFactory;
    import com.focus.smq.TableCompte;
    import com.focus.smq.TableCompteDAO;

    public class TestExemple {

    public static void main (String[] args)
    throws HibernateException{
    TableCompte tablecompte =new TableCompte();
    TableCompteDAO dao = new TableCompteDAO();
    //Session session =HibernateSessionFactory.getSession();
    Transaction tx = dao.getSession().beginTransaction();
    ajouter(tablecompte);
    dao.save(tablecompte);
    tx.commit();
    dao.getSession().close();

    }

    private static void ajouter(TableCompte tab) {
    tab.setCin(15);
    tab.setNom(“rrrr”);
    tab.setPrenom(“yyyy”);

    }

    }

    #269140

    simadou
    Member

    Salut
    Merci tous j’ai trouvé enfin la solution.
    J’ai renommé la calss persistante
    Bye 😛

    #269141

    simadou
    Member

    @simadou wrote:

    Salut
    Merci tous j’ai trouvé enfin la solution.
    l’erreur : j’ai renommé la calss persistante
    Bye 😛

    #269148

    Riyad Kalla
    Member

    Simadou,
    At this time the forums are English-only. Please restate your question in English and we’ll see if we can help.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Erreur de creation SessionFactory

You must be logged in to post in the forum log in