-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: [debutant]NoClassDefFoundError ?!
PostPosted: Fri Jul 22, 2005 5:24 am 
Newbie

Joined: Fri Apr 15, 2005 4:57 am
Posts: 13
Location: Lyon, France
bonjour,

Me voici avec un problem trés génant et pas trop compréhensible !
Je tente de migrer vers hibernate3 et je me retrouve avec cette erreur :

Code:
Caused by: 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 org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:603)
   at fr.ggl.uc.admin.EssaiTypeUCEjbBean.testHib(EssaiTypeUCEjbBean.java:277)


avec ce code.

Code:
public void testHib(UcRequest request) throws SibException {

    SessionFactory sessionFactory = HbnSession.getSessionFactory(HbnSession.CRISTAL);
    Session session = sessionFactory.openSession();
    Transaction tx = null;
    try {
      tx = session.beginTransaction();
     
      EssaiTypeDm dm = (EssaiTypeDm) session.get(EssaiTypeDm.class, new Long(2));
      assert dm.getColor() != null : "Attention la couleur ne doit pas être null";
      Color color = dm.getColor();
      // pas de pb, je continue.
     
      String hqlQuery = "SELECT COUNT (*) FROM essaitype";     
      Query query = session.createQuery(hqlQuery);
      //ET VOILA LA SOURCE D'ERREUR !!
      Integer integer = (Integer) query.uniqueResult();
     
      tx.commit();
    }
    catch (Exception e) {
      if (tx != null) tx.rollback();
      e.printStackTrace();
    }
    finally {
      session.close();
    }
  }



Hibernate version: 3.0.5


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 22, 2005 7:24 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/?cmd=srchdoc&q ... FoundError


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 25, 2005 7:23 am 
Beginner
Beginner

Joined: Tue Jul 12, 2005 11:15 am
Posts: 29
il te manque le jar zntlr dans ton classpath: antlr-2.7.5H3.jar

pimento.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.