NodeTraverser throws unhandled IllegalArgumentException on bogus query
----------------------------------------------------------------------
Key: HHH-2080
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2080
Project: Hibernate3
Type: Bug
Components: query-hql
Versions: 3.2.0.cr4
Environment: 3.2.0.cr4, MySQL 5.0
Reporter: Anders Wallgren
One of our unit tests uses a bogus query string to test some error handle. In this case,
the query string is "blah" -- I would have expected a QuerySyntaxException here,
not an IllegalArgumentException from deep within the HQL parser.
Stack trace from the log:
{code}
2006-09-17T16:00:30.689 | ERROR | main | RunQuery
| PARSER | line 1:1: unexpected token: blah
2006-09-17T16:00:30.689 | ERROR | main | RunQuery
| OperationInvoker | Operation exception: node to traverse cannot be
null!
java.lang.IllegalArgumentException: node to traverse cannot be null!
at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:31)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
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:585)
at
org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1184)
at $Proxy54.createQuery(Unknown Source)
at
com.electriccloud.commander.hibernate.HibernateCommanderDao$4.doInHibernate(HibernateCommanderDao.java:2117)
at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:361)
at
org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:327)
at
com.electriccloud.commander.hibernate.HibernateCommanderDao.runQuery(HibernateCommanderDao.java:2131)
at com.electriccloud.commander.api.RunQueryOperation.perform(RunQueryOperation.java:71)
at
com.electriccloud.commander.operations.OperationInvoker.invoke(OperationInvoker.java:150)
at
com.electriccloud.commander.operations.OperationProxyImpl.perform(OperationProxyImpl.java:134)
at
com.electriccloud.commander.operations.OperationTestHelper.assertOperationException(OperationTestHelper.java:408)
at
com.electriccloud.commander.operations.OperationTestHelper.assertOperationException(OperationTestHelper.java:391)
at
com.electriccloud.commander.api.RunQueryOperationTest.testInvalidQuery(RunQueryOperationTest.java:70)
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:585)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at junit.textui.TestRunner.doRun(TestRunner.java:115)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
at junit.textui.TestRunner.doRun(TestRunner.java:108)
at
com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
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:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira