I'm getting a NullPOinterException from org.hibernate.hql.ast.util.SessionFactoryHelper.findSQLFunction(SessionFactoryHelper.java:342)
on the query: SELECT Publication FROM Citation AS c WHERE c.enamelId = '0323' ORDER BY c.publication.year
Any idea if this is caused by (my) underlying user error?
Hibernate version: 3.2.0 GA, GA versions of annotations and entity manager on Glassfish 9.0_01 (build b14)
Mapping documents:
from Citation:
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(insertable=false, updatable=false)
private String pubId;
@Column(name="pieceAka", insertable=false, updatable=false)
private String enamelId;
private String changedby;
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="pieceAka")
private Enamel enamel;
@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="pubId")
private Publication publication;
Name and version of the database you are using: MySQL 5.0
log excerpt with stacktrace:
17:25:17,625 INFO ExhibitionFacadeBean:42 - init complete
17:25:17,640 INFO ExhibitionFacadeBean:57 - testQuery: SELECT Publication FROM Citation AS c WHERE c.enamelId = '0323' ORDER BY c.publication.year
17:25:17,718 DEBUG SessionImpl:220 - opened session at timestamp: 11629491176
17:25:17,718 DEBUG JDBCContext:160 - TransactionFactory reported no active transaction; Synchronization not registered
17:25:17,718 DEBUG AbstractEntityManagerImpl:450 - Looking for a JTA transaction to join
17:25:17,750 DEBUG JDBCContext:172 - successfully registered Synchronization
17:25:17,750 DEBUG AbstractEntityManagerImpl:480 - Adding flush() and close() synchronization
17:25:17,765 DEBUG QueryPlanCache:70 - unable to locate HQL query plan in cache; generating (SELECT Publication FROM Citation AS c WHERE c.enamelId = '0323' ORDER BY c.publication.year)
17:25:17,796 DEBUG CacheSynchronization:82 - transaction after completion callback, status: 4
17:25:17,812 DEBUG JDBCContext:215 - after transaction completion
17:25:17,812 DEBUG SessionImpl:422 - after transaction completion
17:25:17,812 DEBUG JDBCContext:160 - TransactionFactory reported no active transaction; Synchronization not registered
17:25:17,812 DEBUG JDBCContext:160 - TransactionFactory reported no active transaction; Synchronization not registered
17:25:17,812 DEBUG JDBCContext:160 - TransactionFactory reported no active transaction; Synchronization not registered
17:25:17,812 DEBUG JDBCContext:160 - TransactionFactory reported no active transaction; Synchronization not registered
17:25:17,812 DEBUG JDBCContext:160 - TransactionFactory reported no active transaction; Synchronization not registered
17:25:17,812 DEBUG SessionImpl:273 - closing session
17:25:17,812 DEBUG ConnectionManager:369 - connection already null in cleanup : no action
EJB5018: An exception was thrown during an ejb invocation on [ExhibitionFacadeBean]
javax.ejb.EJBException
at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:197)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:110)
at $Proxy51.testQuery(Unknown Source)
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:589)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
Caused by: java.lang.NullPointerException
at org.hibernate.hql.ast.util.SessionFactoryHelper.findSQLFunction(SessionFactoryHelper.java:342)
at org.hibernate.hql.ast.tree.IdentNode.getDataType(IdentNode.java:266)
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:143)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:712)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:536)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
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:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
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 org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:92)
at com.sun.enterprise.util.EntityManagerWrapper.createQuery(EntityManagerWrapper.java:543)
at com.schwarcz.enamels.model.ExhibitionFacadeBean.testQuery(ExhibitionFacadeBean.java:59)
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:589)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
... 17 more
|