org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree []

Hibernate JIRA | Markus Junginger | 1 decade ago
  1. 0

    "ERROR main org.hibernate.hql.PARSER - <AST>:0:0: unexpected end of subtree" shows up if no elements are available for "Session factory" (double click in the "Hibernate Configuration" Eclipse view). Also "Session is closed" error in the log. !MESSAGE Exception while executing HQL Query !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-02-13 11:13:42.116 !MESSAGE org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [] !STACK 0 org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [] at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:225) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105) 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:1601) at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:77) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:292) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282) at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133) at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by: <AST>:0:0: unexpected end of subtree at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2943) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218) ... 46 more !ENTRY org.eclipse.ui.workbench 4 0 2006-02-13 11:13:13.522 !MESSAGE Session is closed! !STACK 0 org.hibernate.SessionException: Session is closed! at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:50) at org.hibernate.impl.SessionImpl.contains(SessionImpl.java:1574) at org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.getPropertySource(HibernatePropertySourceProvider.java:35) at org.eclipse.ui.views.properties.PropertySheetEntry.getPropertySource(PropertySheetEntry.java:456) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:728) at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:597) at org.eclipse.ui.views.properties.PropertySheetEntry.createChildEntries(PropertySheetEntry.java:241) at org.eclipse.ui.views.properties.PropertySheetEntry.getChildEntries(PropertySheetEntry.java:339) at org.eclipse.ui.views.properties.PropertySheetViewer.updateCategories(PropertySheetViewer.java:981) at org.eclipse.ui.views.properties.PropertySheetViewer.updateChildrenOf(PropertySheetViewer.java:1146) at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:877) at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:392) at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:212) at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156) at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62) at org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:151) at org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:165) at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:108) at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52) at javax.swing.AbstractListModel.fireContentsChanged(Unknown Source) at org.hibernate.console.QueryPageModel.remove(QueryPageModel.java:92) at org.hibernate.eclipse.console.actions.CloseQueryPageAction.run(CloseQueryPageAction.java:45) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)

    Hibernate JIRA | 1 decade ago | Markus Junginger
    org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree []
  2. 0

    "ERROR main org.hibernate.hql.PARSER - <AST>:0:0: unexpected end of subtree" shows up if no elements are available for "Session factory" (double click in the "Hibernate Configuration" Eclipse view). Also "Session is closed" error in the log. !MESSAGE Exception while executing HQL Query !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-02-13 11:13:42.116 !MESSAGE org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [] !STACK 0 org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [] at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:225) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105) 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:1601) at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:77) at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:292) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287) at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282) at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133) at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044) at org.eclipse.core.runtime.Platform.run(Platform.java:783) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718) at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Caused by: <AST>:0:0: unexpected end of subtree at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2943) at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:688) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:544) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:218) ... 46 more !ENTRY org.eclipse.ui.workbench 4 0 2006-02-13 11:13:13.522 !MESSAGE Session is closed! !STACK 0 org.hibernate.SessionException: Session is closed! at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:50) at org.hibernate.impl.SessionImpl.contains(SessionImpl.java:1574) at org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.getPropertySource(HibernatePropertySourceProvider.java:35) at org.eclipse.ui.views.properties.PropertySheetEntry.getPropertySource(PropertySheetEntry.java:456) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:728) at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:597) at org.eclipse.ui.views.properties.PropertySheetEntry.createChildEntries(PropertySheetEntry.java:241) at org.eclipse.ui.views.properties.PropertySheetEntry.getChildEntries(PropertySheetEntry.java:339) at org.eclipse.ui.views.properties.PropertySheetViewer.updateCategories(PropertySheetViewer.java:981) at org.eclipse.ui.views.properties.PropertySheetViewer.updateChildrenOf(PropertySheetViewer.java:1146) at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:877) at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:392) at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:212) at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156) at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62) at org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:151) at org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:165) at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:108) at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52) at javax.swing.AbstractListModel.fireContentsChanged(Unknown Source) at org.hibernate.console.QueryPageModel.remove(QueryPageModel.java:92) at org.hibernate.eclipse.console.actions.CloseQueryPageAction.run(CloseQueryPageAction.java:45) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)

    Hibernate JIRA | 1 decade ago | Markus Junginger
    org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree []
  3. 0

    How to use inner join query in hql?

    Stack Overflow | 2 years ago | Akshant poonia
    org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1, column 74 [select user_name, message from com.csc.project.user e inner join tweet p on p.user_id=e.id where e.user_name=:name]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate Community • View topic - Using List in HQL WHERE clause

    hibernate.org | 7 months ago
    org.springframework.orm.hibernate3.HibernateQueryException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]
  6. 0

    If you call CriteriaBuilder.function() respectively "ParameterizedFunctionExpression" with two or more arguments you get an IllegalArgumentException. I think the bug is here: protected void renderArguments(StringBuilder buffer, CriteriaQueryCompiler.RenderingContext renderingContext) { for ( Expression argument : argumentExpressions ) { buffer.append( ( (Renderable) argument ).render( renderingContext ) ); } } The arguments are not seperated by comma. Exception: Exception in thread "main" java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 37 [select TO_CHAR(generatedAlias0.date1:param0) from test.server.TestBean as generatedAlias0] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1166) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1112) at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:315) at org.hibernate.ejb.criteria.CriteriaQueryCompiler.compile(CriteriaQueryCompiler.java:154) at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:432) at test.server.TestApp.main(TestApp.java:28) Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 37 [select TO_CHAR(generatedAlias0.date1:param0) from test.server.TestBean as generatedAlias0] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136) 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:98) 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:1760) at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:297) ... 3 more Code: EntityManagerFactory factory = Persistence.createEntityManagerFactory("userDatabase"); EntityManager em = factory.createEntityManager(); CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<String> createQuery = cb.createQuery(String.class); Root<TestBean> from = createQuery.from(TestBean.class); Expression<String> param = cb.literal("DD.MM.YYYY"); createQuery.select(cb.function("TO_CHAR", String.class, from.get(TestBean_.date1), param)); List<String> resultList = em.createQuery(createQuery).getResultList();

    Hibernate JIRA | 7 years ago | Max Hartmann
    java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 37 [select TO_CHAR(generatedAlias0.date1:param0) from test.server.TestBean as generatedAlias0]

    6 unregistered visitors
    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. org.hibernate.hql.ast.QuerySyntaxException

      unexpected end of subtree []

      at org.hibernate.hql.ast.ErrorCounter.throwQueryException()
    2. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.compile
      1. org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
      2. org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:225)
      3. org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:158)
      4. org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:105)
      4 frames
    3. Hibernate
      SessionImpl.createQuery
      1. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
      2. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
      3. org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
      4. org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:134)
      5. org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:113)
      6. org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1601)
      6 frames
    4. org.hibernate.console
      ConsoleConfiguration.executeHQLQuery
      1. org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:77)
      2. org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:292)
      3. org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
      4. org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287)
      5. org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282)
      5 frames
    5. org.hibernate.eclipse
      KnownConfigurationsView$1.doubleClick
      1. org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133)
      2. org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77)
      2 frames
    6. JFace
      StructuredViewer$1.run
      1. org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720)
      1 frame
    7. Eclipse Core
      Platform.run
      1. org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
      2. org.eclipse.core.runtime.Platform.run(Platform.java:783)
      2 frames
    8. Eclipse UI
      JFaceUtil$1.run
      1. org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
      1 frame
    9. JFace
      OpenStrategy$1.handleEvent
      1. org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
      2. org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718)
      3. org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950)
      4. org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057)
      5. org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219)
      6. org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216)
      7. org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275)
      7 frames
    10. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
      2. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
      3. org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125)
      4. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758)
      4 frames
    11. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
      3. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
      3 frames
    12. Eclipse UI
      IDEApplication.run
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
      2. org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
      2 frames
    13. Eclipse Core
      PlatformActivator$1.run
      1. org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
      1 frame
    14. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
      2. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
      2 frames
    15. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    16. Equinox
      Main.main
      1. org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
      2. org.eclipse.core.launcher.Main.basicRun(Main.java:278)
      3. org.eclipse.core.launcher.Main.run(Main.java:973)
      4. org.eclipse.core.launcher.Main.main(Main.java:948)
      4 frames