java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The statement work fine on version 3.2.5, since upgrade to 3.2.7 it throw exception, and I try the latest 4.1.6 got the same problem. ---------------------------------------------------------- Exception in thread "main" java.lang.NullPointerException at org.hibernate.dialect.function.CastFunction.render(CastFunction.java:36) at org.hibernate.hql.ast.SqlGenerator.endFunctionTemplate(SqlGenerator.java:197) at org.hibernate.hql.antlr.SqlGeneratorBase.methodCall(SqlGeneratorBase.java:2223) at org.hibernate.hql.antlr.SqlGeneratorBase.selectExpr(SqlGeneratorBase.java:1897) at org.hibernate.hql.antlr.SqlGeneratorBase.selectColumn(SqlGeneratorBase.java:1743) at org.hibernate.hql.antlr.SqlGeneratorBase.selectClause(SqlGeneratorBase.java:527) at org.hibernate.hql.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:175) at org.hibernate.hql.antlr.SqlGeneratorBase.insertStatement(SqlGeneratorBase.java:444) at org.hibernate.hql.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:137) at org.hibernate.hql.ast.exec.BasicExecutor.<init>(BasicExecutor.java:42) at org.hibernate.hql.ast.QueryTranslatorImpl.buildAppropriateStatementExecutor(QueryTranslatorImpl.java:535) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:178) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:113) 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:1624) at com.gss.lager.HibernateTest.main(HibernateTest.java:42) ------------------------------------------------------------------- sample code : StringBuffer incoming = new StringBuffer(); incoming.append("insert into DagEdgeImpl(entryEdgeId) ") .append("select edge.id ") .append("from DagEdgeImpl edge ") .append("where edge.endVertex.higherBits = ? ") .append("and edge.endVertex.lowerBits = ? "); log.debug("incoming sql : " + incoming); Query query = session.createQuery(incoming.toString()); query.setLong(0, -552857267868777299L); query.setLong(1, -5131265078905782943L); query.executeUpdate(); hbm : <hibernate-mapping package="com.gss.lager.texture.domain.impl"> <class name="DagEdgeImpl" table="LAGER_DAG_TC_EDGE"> <id name="id" column="id" type="long"> <generator class="native"> <param name="sequence">SEQ_DAG_TC_EDGE</param> </generator> </id> <version name="version" column="version" type="long"/> <property name="entryEdgeId" column="entry_edge_id" type="long" index="LAGER_DAG_ENTRY_EDGE_IDX"/> <property name="directEdgeId" column="direct_edge_id" type="long" index="LAGER_DAG_DIRECT_EDGE_IDX"/> <property name="exitEdgeId" column="exit_edge_id" type="long" index="LAGER_DAG_EXIT_EDGE_IDX"/> <property name="hops" column="hops" type="long" not-null="true" index="LAGER_DAG_HOPS"/> <property name="dagId" column="dag_id" type="string" not-null="true" index="LAGER_DAG_ID_IDX"/> <component name="startVertex" class="com.gss.lager.texture.domain.UUID"> <property name="higherBits" column="start_vertex_hi" index="LAGER_DAG_START_VTX_HI"/> <property name="lowerBits" column="start_vertex_lo" index="LAGER_DAG_START_VTX_LO"/> </component> <component name="endVertex" class="com.gss.lager.texture.domain.UUID"> <property name="higherBits" column="end_vertex_hi" index="LAGER_DAG_END_VTX_HI"/> <property name="lowerBits" column="end_vertex_lo" index="LAGER_DAG_END_VTX_LO"/> </component> </class> </hibernate-mapping>
    via by finion,
  • The statement work fine on version 3.2.5, since upgrade to 3.2.7 it throw exception, and I try the latest 4.1.6 got the same problem. ---------------------------------------------------------- Exception in thread "main" java.lang.NullPointerException at org.hibernate.dialect.function.CastFunction.render(CastFunction.java:36) at org.hibernate.hql.ast.SqlGenerator.endFunctionTemplate(SqlGenerator.java:197) at org.hibernate.hql.antlr.SqlGeneratorBase.methodCall(SqlGeneratorBase.java:2223) at org.hibernate.hql.antlr.SqlGeneratorBase.selectExpr(SqlGeneratorBase.java:1897) at org.hibernate.hql.antlr.SqlGeneratorBase.selectColumn(SqlGeneratorBase.java:1743) at org.hibernate.hql.antlr.SqlGeneratorBase.selectClause(SqlGeneratorBase.java:527) at org.hibernate.hql.antlr.SqlGeneratorBase.selectStatement(SqlGeneratorBase.java:175) at org.hibernate.hql.antlr.SqlGeneratorBase.insertStatement(SqlGeneratorBase.java:444) at org.hibernate.hql.antlr.SqlGeneratorBase.statement(SqlGeneratorBase.java:137) at org.hibernate.hql.ast.exec.BasicExecutor.<init>(BasicExecutor.java:42) at org.hibernate.hql.ast.QueryTranslatorImpl.buildAppropriateStatementExecutor(QueryTranslatorImpl.java:535) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:178) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:113) 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:1624) at com.gss.lager.HibernateTest.main(HibernateTest.java:42) ------------------------------------------------------------------- sample code : StringBuffer incoming = new StringBuffer(); incoming.append("insert into DagEdgeImpl(entryEdgeId) ") .append("select edge.id ") .append("from DagEdgeImpl edge ") .append("where edge.endVertex.higherBits = ? ") .append("and edge.endVertex.lowerBits = ? "); log.debug("incoming sql : " + incoming); Query query = session.createQuery(incoming.toString()); query.setLong(0, -552857267868777299L); query.setLong(1, -5131265078905782943L); query.executeUpdate(); hbm : <hibernate-mapping package="com.gss.lager.texture.domain.impl"> <class name="DagEdgeImpl" table="LAGER_DAG_TC_EDGE"> <id name="id" column="id" type="long"> <generator class="native"> <param name="sequence">SEQ_DAG_TC_EDGE</param> </generator> </id> <version name="version" column="version" type="long"/> <property name="entryEdgeId" column="entry_edge_id" type="long" index="LAGER_DAG_ENTRY_EDGE_IDX"/> <property name="directEdgeId" column="direct_edge_id" type="long" index="LAGER_DAG_DIRECT_EDGE_IDX"/> <property name="exitEdgeId" column="exit_edge_id" type="long" index="LAGER_DAG_EXIT_EDGE_IDX"/> <property name="hops" column="hops" type="long" not-null="true" index="LAGER_DAG_HOPS"/> <property name="dagId" column="dag_id" type="string" not-null="true" index="LAGER_DAG_ID_IDX"/> <component name="startVertex" class="com.gss.lager.texture.domain.UUID"> <property name="higherBits" column="start_vertex_hi" index="LAGER_DAG_START_VTX_HI"/> <property name="lowerBits" column="start_vertex_lo" index="LAGER_DAG_START_VTX_LO"/> </component> <component name="endVertex" class="com.gss.lager.texture.domain.UUID"> <property name="higherBits" column="end_vertex_hi" index="LAGER_DAG_END_VTX_HI"/> <property name="lowerBits" column="end_vertex_lo" index="LAGER_DAG_END_VTX_LO"/> </component> </class> </hibernate-mapping>
    via by finion,
  • Cast field in JPA Query
    via Stack Overflow by PaolaG
    ,
    • java.lang.NullPointerException at org.hibernate.dialect.function.CastFunction.render(CastFunction.java:56) at org.hibernate.hql.ast.SqlGenerator.endFunctionTemplate(SqlGenerator.java:214) at org.hibernate.hql.antlr.SqlGeneratorBase.methodCall(SqlGeneratorBase.java:2325)
    No Bugmate found.