net.sf.hibernate.QueryException: unexpected token: in [from Person in class com.vcdeals.db2.Person]

Hibernate JIRA | Neil Katin | 1 decade ago
  1. 0

    I'm kind of hoping I'm just confused because it seems a bit hard to believe: findAll() doesn't seem to work. This is using the standard FinderRenderer in the net.sf.hibernate.tool.hbm2java package. The generated findAll looks like this: public static List findAll() throws SQLException, HibernateException { Session session = com.vcdeals.BrokerManager.getSession(); List finds = session.find("from Person in class com.vcdeals.db2.Person"); return finds; } This code generates the following hibernate error: net.sf.hibernate.QueryException: unexpected token: in [from Person in class com.vcdeals.db2.Person] at net.sf.hibernate.hql.FromParser.token(FromParser.java:89) 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:1530) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483) at com.vcdeals.db2.PersonFinder.findAll(PersonFinder.java:47) at com.vcdeals.servlet.AdminServlet.ensureAdminUser(AdminServlet.java:127) at com.vcdeals.servlet.AdminServlet.init(AdminServlet.java:108) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) (and so on...) Replacing the find query string with "from Person as person" cures the problem -- the find works. Here's a context diff of FinderRenderer with the source patched to automatically generate this: *** FinderRenderer.java Sat Feb 21 17:21:52 2004 --- FinderRenderer.java.fixed Sun Feb 22 14:56:29 2004 *************** *** 243,250 **** + "throws SQLException, HibernateException {"); writer.println(" Session session = " + sessionMethod); } ! writer.println(" List finds = session.find(\"from " + classMapping.getName() ! + " in class " + classMapping.getPackageName() + "." + classMapping.getName() + "\");"); writer.println(" return finds;"); writer.println(" }"); writer.println(); --- 243,251 ---- + "throws SQLException, HibernateException {"); writer.println(" Session session = " + sessionMethod); } ! writer.println(" List finds = session.find(\"from " + classMapping.getName() ! + " as " + classMapping.getName().toLowerCase() ! + "\");"); writer.println(" return finds;"); writer.println(" }"); writer.println();

    Hibernate JIRA | 1 decade ago | Neil Katin
    net.sf.hibernate.QueryException: unexpected token: in [from Person in class com.vcdeals.db2.Person]
  2. 0

    I'm kind of hoping I'm just confused because it seems a bit hard to believe: findAll() doesn't seem to work. This is using the standard FinderRenderer in the net.sf.hibernate.tool.hbm2java package. The generated findAll looks like this: public static List findAll() throws SQLException, HibernateException { Session session = com.vcdeals.BrokerManager.getSession(); List finds = session.find("from Person in class com.vcdeals.db2.Person"); return finds; } This code generates the following hibernate error: net.sf.hibernate.QueryException: unexpected token: in [from Person in class com.vcdeals.db2.Person] at net.sf.hibernate.hql.FromParser.token(FromParser.java:89) 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:1530) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483) at com.vcdeals.db2.PersonFinder.findAll(PersonFinder.java:47) at com.vcdeals.servlet.AdminServlet.ensureAdminUser(AdminServlet.java:127) at com.vcdeals.servlet.AdminServlet.init(AdminServlet.java:108) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) (and so on...) Replacing the find query string with "from Person as person" cures the problem -- the find works. Here's a context diff of FinderRenderer with the source patched to automatically generate this: *** FinderRenderer.java Sat Feb 21 17:21:52 2004 --- FinderRenderer.java.fixed Sun Feb 22 14:56:29 2004 *************** *** 243,250 **** + "throws SQLException, HibernateException {"); writer.println(" Session session = " + sessionMethod); } ! writer.println(" List finds = session.find(\"from " + classMapping.getName() ! + " in class " + classMapping.getPackageName() + "." + classMapping.getName() + "\");"); writer.println(" return finds;"); writer.println(" }"); writer.println(); --- 243,251 ---- + "throws SQLException, HibernateException {"); writer.println(" Session session = " + sessionMethod); } ! writer.println(" List finds = session.find(\"from " + classMapping.getName() ! + " as " + classMapping.getName().toLowerCase() ! + "\");"); writer.println(" return finds;"); writer.println(" }"); writer.println();

    Hibernate JIRA | 1 decade ago | Neil Katin
    net.sf.hibernate.QueryException: unexpected token: in [from Person in class com.vcdeals.db2.Person]
  3. 0

    bad sql in htmlpageFactory.getLiveHTMLPages

    GitHub | 4 years ago | dotjorgeu
    net.sf.hibernate.QueryException: unexpected token: html [from inode in class com.dotmarketing.portlets.htmlpages.model.HTMLPage html, com.dotmarketing.portlets.htmlpages.model.HTMLPageVersionInfo vv where type='htmlpage' and identifier=vv.identifier and vv.live_inode=inode and vv.deleted=0]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    2010-01-08 12:18:04,652 ERROR [1344706967@qtp-2045652012-0] [runtime] get(approximateIndexTime) failed on instance of com.atlassian.bamboo.configuration.DefaultSystemStatisticsBean The problematic instruction: ---------- ==> ${dateUtils.formatDurationPretty(systemStatisticsBean.approximateIndexTime)} [on line 69, column 63 in admin/systemInfo.ftl] in user-directive ww.label [on line 69, column 9 in admin/systemInfo.ftl] in user-directive ui.bambooSection [on line 65, column 5 in admin/systemInfo.ftl] in user-directive ui.bambooPanel [on line 9, column 5 in admin/systemInfo.ftl] ---------- Java backtrace for programmers: ---------- freemarker.template.TemplateModelException: get(approximateIndexTime) failed on instance of com.atlassian.bamboo.configuration.DefaultSystemStatisticsBean at freemarker.ext.beans.BeanModel.get(BeanModel.java:223) at freemarker.core.Dot._getAsTemplateModel(Dot.java:76) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.ListLiteral.getModelList(ListLiteral.java:119) at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:89) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.Expression.getStringValue(Expression.java:93) at freemarker.core.DollarVariable.accept(DollarVariable.java:76) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.Environment.renderElementToString(Environment.java:1568) at freemarker.core.StringLiteral.getStringValue(StringLiteral.java:101) at freemarker.core.StringLiteral._getAsTemplateModel(StringLiteral.java:86) at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:119) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.Environment.visit(Environment.java:394) at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.Macro$Context.runMacro(Macro.java:168) at freemarker.core.Environment.visit(Environment.java:602) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.Environment.visit(Environment.java:394) at freemarker.core.BodyInstruction.accept(BodyInstruction.java:93) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.Macro$Context.runMacro(Macro.java:168) at freemarker.core.Environment.visit(Environment.java:602) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:106) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.MixedContent.accept(MixedContent.java:92) at freemarker.core.Environment.visit(Environment.java:209) at freemarker.core.Environment.process(Environment.java:189) at freemarker.template.Template.process(Template.java:237) at com.opensymphony.webwork.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:214) at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:143) at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:313) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:208) at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:175) at com.atlassian.bamboo.ww2.interceptors.BambooWorkflowInterceptor.doIntercept(BambooWorkflowInterceptor.java:33) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:116) at com.atlassian.bamboo.ww2.interceptors.BambooValidationInterceptor.doIntercept(BambooValidationInterceptor.java:33) at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.JSONValidationInterceptor.intercept(JSONValidationInterceptor.java:74) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:174) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptor.intercept(WebworkSecurityInterceptor.java:55) at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptorProxy.intercept(WebworkSecurityInterceptorProxy.java:30) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.PaginationAwareInterceptor.intercept(PaginationAwareInterceptor.java:81) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.StatisticsAwareInterceptor.intercept(StatisticsAwareInterceptor.java:41) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.ResultsListAwareInterceptor.intercept(ResultsListAwareInterceptor.java:48) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.TestCaseAwareInterceptor.intercept(TestCaseAwareInterceptor.java:44) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.BuildResultsSummaryAwareInteceptor.intercept(BuildResultsSummaryAwareInteceptor.java:66) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.ChainAwareInterceptor.intercept(ChainAwareInterceptor.java:93) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.BuildAwareInterceptor.intercept(BuildAwareInterceptor.java:46) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.atlassian.bamboo.ww2.interceptors.PlanAwareInterceptor.intercept(PlanAwareInterceptor.java:53) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116) at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:274) at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118) at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.opensymphony.webwork.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:88) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.bamboo.filter.AccessLogFilter.doFilter(AccessLogFilter.java:61) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at com.atlassian.bamboo.filter.SeraphLoginFilter.doFilter(SeraphLoginFilter.java:61) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at com.atlassian.bamboo.filter.BambooAcegiProxyFilter.doFilter(BambooAcegiProxyFilter.java:25) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.bamboo.filter.LicenseFilter.doFilter(LicenseFilter.java:73) at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.johnson.filters.AbstractJohnsonFilter.doFilter(AbstractJohnsonFilter.java:72) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.seraph.filter.SecurityFilter.doFilter(SecurityFilter.java:206) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.seraph.filter.BaseLoginFilter.doFilter(BaseLoginFilter.java:133) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66) at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:69) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:170) at com.atlassian.spring.filter.FlushingSpringSessionInViewFilter.doFilterInternal(FlushingSpringSessionInViewFilter.java:29) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.planetj.servlet.filter.compression.CompressingFilter.handleDoFilter(CompressingFilter.java:203) at com.planetj.servlet.filter.compression.CompressingFilter.doFilter(CompressingFilter.java:193) at com.atlassian.bamboo.filter.CompressingFilter.doFilter(CompressingFilter.java:65) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.bamboo.filter.RequestCacheThreadLocalFilter.doFilter(RequestCacheThreadLocalFilter.java:26) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:55) at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:41) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1139) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:378) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:535) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:865) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:840) at freemarker.ext.beans.BeanModel.invokeThroughDescriptor(BeanModel.java:276) at freemarker.ext.beans.BeanModel.get(BeanModel.java:183) ... 177 more Caused by: org.springframework.orm.hibernate.HibernateQueryException: unexpected token: AND [ select count(*) from com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl b AND b.buildState != 'Pending' ]; nested exception is net.sf.hibernate.QueryException: unexpected token: AND [ select count(*) from com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl b AND b.buildState != 'Pending' ] at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:581) at org.springframework.orm.hibernate.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:353) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:375) at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao.countBuildResultsSummaries(BuildResultsSummaryHibernateDao.java:129) at com.atlassian.bamboo.resultsummary.BuildResultsSummaryManagerImpl.countBuildResultsSummaries(BuildResultsSummaryManagerImpl.java:274) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at com.atlassian.bamboo.security.acegi.intercept.aopalliance.AuthorityOverrideMethodSecurityInterceptor.invoke(AuthorityOverrideMethodSecurityInterceptor.java:30) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy23.countBuildResultsSummaries(Unknown Source) at com.atlassian.bamboo.configuration.DefaultSystemStatisticsBean.getNumberOfResults(DefaultSystemStatisticsBean.java:45) at com.atlassian.bamboo.configuration.DefaultSystemStatisticsBean.getApproximateIndexTime(DefaultSystemStatisticsBean.java:50) ... 184 more Caused by: net.sf.hibernate.QueryException: unexpected token: AND [ select count(*) from com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl b AND b.buildState != 'Pending' ] at net.sf.hibernate.hql.FromParser.token(FromParser.java:101) 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:295) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1572) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49) at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:550) at com.atlassian.bamboo.resultsummary.BuildResultsSummaryHibernateDao$4.doInHibernate(BuildResultsSummaryHibernateDao.java:143) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) ... 205 more

    Atlassian JIRA | 7 years ago | Belinda Teh [Atlassian]
    net.sf.hibernate.QueryException: unexpected token: AND [ select count(*) from com.atlassian.bamboo.resultsummary.BuildResultsSummaryImpl b AND b.buildState != 'Pending' ]
  6. 0

    I'm switching to 2.0.1 from 1.2.3. I received the following error trying to do a query on a collection that's within a component. Obviously, this used to work in 1.2.3. I've included part of my mapping below. Using elements(mov.cast.cast.list) did not help. net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements] at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:223) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:270) at net.sf.hibernate.hql.WhereParser.preprocess(WhereParser.java:347) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:355) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:389) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:275) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:73) at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:120) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:145) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:132) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:373) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:351) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1381) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1345) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:76) at com.fetchaflick.videotest.ojb.FetchaQuery.list(FetchaQuery.java:45) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageBy(BaseMovieFinder.java:62) at com.fetchaflick.videotest.movie.BaseMovieFinder.findPageByActor(BaseMovieFinder.java:45) at com.fetchaflick.videotest.movie.MovieFinderTest.testFindByActor(MovieFinderTest.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) <class name="Movie" table="PRODUCT"> <component name="component" class="com.fetchaflick.videotest.movie.Cast"> <list name="list" table="MOVIE_CAST" cascade="all"> <jcs-cache usage="read-write"/> <key column="MOVIE_ID"/> <index column="POS"/> <element type="string" column="NAME"/> </list> </component> </class> Original thread on the forum http://sourceforge.net/forum/forum.php?thread_id=889001&forum_id=128638 I put this in JIRA a while ago, but I guess it lost it (and my account)?

    Hibernate JIRA | 1 decade ago | Rex Madden
    net.sf.hibernate.QueryException: could not resolve property type: cast.cast.null [SELECT mov.id FROM mov in class Movie WHERE :findTarget in mov.component.list.elements]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. net.sf.hibernate.QueryException

      unexpected token: in [from Person in class com.vcdeals.db2.Person]

      at net.sf.hibernate.hql.FromParser.token()
    2. net.sf.hibernate
      SessionImpl.find
      1. net.sf.hibernate.hql.FromParser.token(FromParser.java:89)
      2. net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
      3. net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
      4. net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
      5. net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
      6. net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
      7. net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:293)
      8. net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1530)
      9. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1501)
      10. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491)
      11. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483)
      11 frames
    3. com.vcdeals.db2
      PersonFinder.findAll
      1. com.vcdeals.db2.PersonFinder.findAll(PersonFinder.java:47)
      1 frame
    4. com.vcdeals.servlet
      AdminServlet.init
      1. com.vcdeals.servlet.AdminServlet.ensureAdminUser(AdminServlet.java:127)
      2. com.vcdeals.servlet.AdminServlet.init(AdminServlet.java:108)
      2 frames
    5. Glassfish Core
      StandardContext.start
      1. org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
      2. org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
      3. org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948)
      4. org.apache.catalina.core.StandardContext.start(StandardContext.java:4271)
      4 frames