-->
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.  [ 9 posts ] 
Author Message
 Post subject: Problem finding a class in hibernate3.jar
PostPosted: Thu Mar 17, 2005 7:47 pm 
Newbie

Joined: Tue Mar 15, 2005 8:30 pm
Posts: 5
Hello,

I have strange problem. I put hibernate3.jar and all the supporting libs in the classpath and try to run my program to write and load data to my postgresql 7.4 DB. Then I get a: Exception in thread "main" java.lang.NoClassDefFoundError: antlr/ANTLRException

I have found the line that causes the problem with the sources and the debugger in org.hibernate.hql.ast.ASTQueryTranslatorFactory line 27:

public QueryTranslator createQueryTranslator(String queryString,
Map filters,
SessionFactoryImplementor factory) {
-->return new QueryTranslatorImpl( queryString, filters, factory );<--
}

My JVM does not find the class for the Implementation. That is probably not a Hibernate3 problem because the class file exists in the jar and I have recompiled the sources. The question is what can cause my JVM not to find the class? I have tried to import the build dir or tried the cvs version but it does not change a bit. I have tried to get an instance of the class in my programm and got the same result:NoClassDefFoundError. I am using Jdk1.5_01 with Eclipse3.0 and the pg74.1jdbc3.jar Driver for postgresql and hibernate3.0 rc1. I know that this is not a typical hibernate problem but I do not know where else to ask so please point me in the right direction.

The stacktrace:
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:344)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:410)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:814)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:773)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:569)
at persistence.HInterface.getUser(HInterface.java:35)
at persistence.Hibernate_Test.main(Hibernate_Test.java:31)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 2:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
how about adding antlr.jar to your classpath ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 6:36 am 
Newbie

Joined: Tue Mar 15, 2005 8:30 pm
Posts: 5
Hello,

antlr.jar is in the class path.

Greetings
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 6:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well the error says you dont have it in the classpath ...so you must be doing something else.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 19, 2005 10:30 am 
Newbie

Joined: Tue Mar 15, 2005 8:30 pm
Posts: 5
The problem is not within antlr.jar. It is that I cannot get an instance of QueryTranslatorImpl.class in org.hibernate.hql.ast.* .The class file is in the hibernate3.jar but I cannot instanciate it and the Hibernate3 classes cannot either. There must be something wrong with my classpath because I have rebuild hibernate from the sources and the error did not change. I have tried a 1.4.2 JVM and I got the same problem. So the real question is: What is needed to get an instance of QueryTranslatorImpl class? Can you do a new QueryTranslatorImpl(null,null,null) and get an object? If so how does your classpath look like?

Greetings
Sven


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 19, 2005 11:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you could build it then use the same classpath and you should be able to run it.

hibernate3 is dependt on antlr.jar and the exception says that it cannot find antlr/AntlrExcpetion.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 25, 2005 12:54 pm 
Newbie

Joined: Fri Nov 25, 2005 12:48 pm
Posts: 6
Hello,

I have also download hibernate3.jar yesterday, it seems that even if the antlr related .class files are in org/hibernate/hql/antlr, it doesn't work !

Anyway, I download http://www.antlr.org/download/antlr-2.7.5.jar and add it into the classpath, now It works fine for me ! :)

Hope it helps you


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 25, 2005 2:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and why didnt you just use the antlr found in hibernate3/lib ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 25, 2005 10:33 pm 
Newbie

Joined: Fri Nov 25, 2005 12:48 pm
Posts: 6
Quote:
and why didnt you just use the antlr found in hibernate3/lib ?


because I didn't see it :S and I'm a beginner in Hibernate's amazing world lol :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 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.