aspose file tools*
The moose likes Object Relational Mapping and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Exception in thread "main" java.lang.NoSuchFieldError: tokenTypeToASTClassMap" Watch "Exception in thread "main" java.lang.NoSuchFieldError: tokenTypeToASTClassMap" New topic
Author

Exception in thread "main" java.lang.NoSuchFieldError: tokenTypeToASTClassMap

sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 125
Hi All,

I am using Hibernate3.2 for my application.

under Lib directory i have placed following jar files..
-------------------------------------------------------------
hibernate3.jar,jta.jar,antlr-2.7.6.jar,asm.jar,asm-attrs.jar,cglib-2.1.3.jar,commons-collections-2.1.1.jar,commons-logging-1.0.4.jar,dom4j-1.6.1.jar,log4j-1.2.11.jar
-------------------------------------------------------------------

Here is My program
-------------------

---------------------------------------
When i run the above program the following error i am getting,please help to solve this issue..
----------------------------------------

Exception in thread "main" java.lang.NoSuchFieldError: tokenTypeToASTClassMap
at org.hibernate.hql.antlr.HqlBaseParser.buildTokenTypeASTClassMap(HqlBaseParser.java:4559)
at org.hibernate.hql.antlr.HqlBaseParser.<init>(HqlBaseParser.java:116)
at org.hibernate.hql.antlr.HqlBaseParser.<init>(HqlBaseParser.java:121)
at org.hibernate.hql.ast.HqlParser.<init>(HqlParser.java:49)
at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:45)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:242)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at SelectHQLExample.main(SelectHQLExample.java:20)

---------------------------------

Thanks

[ Edited to use code tags - Paul Sturrock ]
[ July 05, 2007: Message edited by: Paul Sturrock ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Please do not duplicate post. Even if someone doesn't reply to your original thread. I have deleted the duplicate thread already.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 125
Hi ALL

ANTL is a parser used to analyse the HQL request, and I knew the problem was coming from it but how and why ?

I was using antlr 2.7.7, I tried antlr 2.7.6, 2.7.5 ..., nothing changed. There was only one antlr like jar in my classpth.

So, I took my project and put antlr to the top of my classpath and all worked fine.

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in thread "main" java.lang.NoSuchFieldError: tokenTypeToASTClassMap
 
Similar Threads
Error: unexpected token: c
Hibernate Desing issue
Difference in session.createQuery() and session.createSqlQuery()
Problem with select query in hibernate
Getting error in Hibernate program