-->
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.  [ 1 post ] 
Author Message
 Post subject: ClassCastException: HqlToken cannot be cast to antlr.Token
PostPosted: Wed Mar 04, 2009 9:53 pm 
Newbie

Joined: Wed Mar 04, 2009 9:31 pm
Posts: 1
Hi All,

I am getting ClassCastException. Here are some details. We have two applications. Both applications using the hibernate and same version and jars added in their jar libs folder. The main application loads the 2nd application using java class loader and loads all the jars inside the .jar file lib foler.
Once both application loaded and database schema created by hibernate, the 2nd application calls one of the method of main application to query the data from main application schema. at this time the query fails to parse and throws ClassCastException as mentioned below.


Here are some details of hibernate and exception. Any help would be appreciated.

Hibernate version: 3.3.1

Full stack trace of any exception that occurs:

Name and version of the database you are using: Postgres 8.2

The generated SQL (show_sql=true): Exception thrown before generating sql


java.lang.ClassCastException: org.hibernate.hql.ast.HqlToken cannot be cast to antlr.Token
at antlr.CharScanner.makeToken(CharScanner.java:173)
at org.hibernate.hql.ast.HqlLexer.makeToken(HqlLexer.java:62)
at org.hibernate.hql.antlr.HqlBaseLexer.mIDENT(HqlBaseLexer.java:580)
at org.hibernate.hql.antlr.HqlBaseLexer.nextToken(HqlBaseLexer.java:264)
at antlr.TokenBuffer.fill(TokenBuffer.java:69)
at antlr.TokenBuffer.LA(TokenBuffer.java:80)
at antlr.LLkParser.LA(LLkParser.java:52)
at org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:139)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:271)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)


Thanks,
MP


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

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.