Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0rc1
Code between sessionFactory.openSession() and session.close():
Code:
numDeleted =
HibernateUtil.getSession()
.createQuery("delete from UserChange where userId = :userId").
setString("userId", userId)
.executeUpate();
The error is showing on the line having
Code:
executeUpate()
NOTE:HibernateUtil.java is available from
http://caveatemptor.hibernate.org
The generated SQL (show_sql=true):
480822be SystemOut O Hibernate: select userchange0_.USER_CHANGE_SET_ID as USER1_0_, userchange0_.USER_CHG_TIMESTAMP as USER2_4_0_, userchange0_.USER_ID as USER3_4_0_, userchange0_.AUDIT_LOG_ID as AUDIT4_4_0_ from UA_RULE.USER_CHANGE_SET userchange0_ where userchange0_.USER_CHANGE_SET_ID=?
Debug level Hibernate log excerpt:
[3/22/05 13:28:52:969 EST] [3/22/05 13:28:53:660 EST] 480822be parser E hql.parser *** ERROR: <AST>:0:0: unexpected end of subtree
[3/22/05 13:28:53:660 EST] 480822be parser E hql.parser *** ERROR: <AST>:0:0: unexpected end of subtree
[3/22/05 13:28:53:670 EST] 480822be SystemErr R
Name and version of the database you are using:
DB2 8.1
Full stack trace of any exception that occurs:
java.lang.NullPointerException
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.antlr.HqlSqlBaseWalker.path(HqlSqlBaseWalker.java:2193)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:2281)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2232)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:498)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:276)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:156)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:414)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:814)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:801)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at org.hibernate.impl.QueryImpl.executeUpate(QueryImpl.java:89)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at com.lmig.vmd_web.dao.UserChangeDAO.delete(UserChangeDAO.java:197)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at com.lmig.vmd_web.test.UserChangeTest.deleteTestData(UserChangeTest.java:160)
[3/22/05 13:28:53:670 EST] 480822be SystemErr R at com.lmig.vmd_web.test.UserChangeTest.runTests(UserChangeTest.java:38)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at org.apache.jsp._test._jspService(_test.java:96)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:357)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java:675)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java:773)
[3/22/05 13:28:53:681 EST] 480822be SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:948)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:530)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
[3/22/05 13:28:53:691 EST] 480822be SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)