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
|