Probleme connexion hibernate
Bonjour,
J'ai une table des villes, j'essaye de tester une classe Villeservice.
J'utilise le code suivant
Citation:
public static void main(String[] args) {
Session session = HibernateSessionFactory.currentSession();
Transaction tx = null;
tx = session.beginTransaction();
Query q = session.createQuery("select from TbVilles v where v.nomVille='Paris'");
List list = q.list();
Iterator it = list.iterator();
while(it.hasNext()){
TbVilles ville = (TbVilles)it.next();
System.out.println(ville.getcode());
}
tx.commit();
J'obtiens l'erreur suivante:
Citation:
WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoClassDefFoundError: antlr/ANTLRException
at org.hibernate.hql.ast.ASTQueryTranslatorFactory.createQueryTranslator(ASTQueryTranslatorFactory.java:27)
at org.hibernate.impl.SessionFactoryImpl.createQueryTranslators(SessionFactoryImpl.java:357)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:423)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at service.VilleService.main(VilleService.java:28)
Aidez moi SVP a resoudre ce probleme.
Merci d'avance.