• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate exception 'unexpected token as'

 
sai kinnera
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am getting the below mentioned expetion when I use hibernate in weblogic J2EE project. Can anybody suggest what would be the mistake. I thought it has something to do with finding the class in classpath. But that was not the problem.

net.sf.hibernate.QueryException: unexpected token: as [select date1.actualDate,ct.courtName from CourtInformationTypeImpl as ct,DateTypeImpl as date1 where 'XXXX condition XXXX' order by date1.actualDate desc]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:94)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:293)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1554)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1525)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)


Thanks in advance,
Sai Kinnera
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using HQL? You are probably trying to query something incorrectly. Re-examine your HQL to see if the syntax is correct. This error is very typical for bad HQL.
 
sai kinnera
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I got the problem corrected. Somehow, the location I have mentioned in the configuration file for the hbm.xml files was not reached at that time. It works fine now.
Thanks,
Sai Kinnera
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic