-->
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.  [ 2 posts ] 
Author Message
 Post subject: Exception at org.hibernate.hql.classic.FromParser.token
PostPosted: Mon Mar 23, 2009 5:57 am 
Newbie

Joined: Mon Mar 23, 2009 2:01 am
Posts: 1
Hi All,

A little help on Hibernate Query Exception.

In my application if i use class files (classes folder) as it is then hibernate queries are working fine. Where as if i convert all class files as jar file and placed into lib then am getting following hibernate exception. I googled but i couldn't get right solution. Could you help me in this issue. Thanks in Advance.

And i am using spring 2.5.5, hibernate 3.3 and antlr-2.7.6

the exception as follows


edu.nus.comcen.epayment.exceptions.GatewayDBException: org.springframework.orm.hibernate3.HibernateQueryException: in expected: applDetl [ from ApplDetail applDetl where applDetl.applCode =:applCode and applDetl.inactiveFlag =:flag and TRUNC(SYSDATE) BETWEEN TRUNC(applDetl.startDate) and TRUNC(applDetl.endDate)]; nested exception is org.hibernate.QueryException: in expected: applDetl [ from ApplDetail applDetl where applDetl.applCode =:applCode and applDetl.inactiveFlag =:flag and TRUNC(SYSDATE) BETWEEN TRUNC(applDetl.startDate) and TRUNC(applDetl.endDate)]
at edu.nus.comcen.common.bao.ApplicationBAO.isValidApplCode(ApplicationBAO.java:447)
at edu.nus.comcen.epayment.web.PaymentListener.validateApplCode(PaymentListener.java:199)
at edu.nus.comcen.epayment.web.PaymentListener.handleRequestInternal(PaymentListener.java:109)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at sun.reflect.GeneratedMethodAccessor427.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
at com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.process(HttpServiceProcessor.java:234)
at com.sun.enterprise.web.HttpServiceWebContainer.service(HttpServiceWebContainer.java:2160)

Caused by: org.springframework.orm.hibernate3.HibernateQueryException: in expected: applDetl [ from ApplDetail applDetl where applDetl.applCode =:applCode and applDetl.inactiveFlag =:flag and TRUNC(SYSDATE) BETWEEN TRUNC(applDetl.startDate) and TRUNC(applDetl.endDate)]; nested exception is org.hibernate.QueryException: in expected: applDetl [ from ApplDetail applDetl where applDetl.applCode =:applCode and applDetl.inactiveFlag =:flag and TRUNC(SYSDATE) BETWEEN TRUNC(applDetl.startDate) and TRUNC(applDetl.endDate)]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:642)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedParam(HibernateTemplate.java:943)
at edu.nus.comcen.common.dao.ApplicationDAOHB.isValidApplCode(ApplicationDAOHB.java:70)
at edu.nus.comcen.common.bao.ApplicationBAO.isValidApplCode(ApplicationBAO.java:445)
... 33 more

Caused by: org.hibernate.QueryException: in expected: applDetl [ from ApplDetail applDetl where applDetl.applCode =:applCode and applDetl.inactiveFlag =:flag and TRUNC(SYSDATE) BETWEEN TRUNC(applDetl.startDate) and TRUNC(applDetl.endDate)]
at org.hibernate.hql.classic.FromParser.token(FromParser.java:106)
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:86)
at org.hibernate.hql.classic.PreprocessingParser.token(PreprocessingParser.java:108)
at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:28)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:178)
at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:154)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1600)
at org.springframework.orm.hibernate3.HibernateTemplate$31.doInHibernate(HibernateTemplate.java:945)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
... 37 more

_________________
- Srinivas


Top
 Profile  
 
 Post subject: Re: Exception at org.hibernate.hql.classic.FromParser.token
PostPosted: Thu Jan 07, 2010 4:50 am 
Newbie

Joined: Thu Jan 07, 2010 4:41 am
Posts: 1
Hello, I'm a new on this site, and specially on this forum, but I just had a similar problem. And the solution, in my case was to remember to put the model class of the specified table on the annotation-classes list in "spring-config.xml" (the xml configuration for the spring). Apparently the spring didn't recognize my model so giving the following exception :

"org.springframework.orm.hibernate3.HibernateQueryException: in expected: bs [from BookStore bswhere bs.title = ?]; nested exception is org.hibernate.QueryException: in expected: bs [from BookStore bs where bs.title= ?]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:921)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)
..... "


Hope it helps :).


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