-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Nullpointer Exception in DotNode
PostPosted: Mon Sep 05, 2005 5:55 am 
Newbie

Joined: Wed Aug 31, 2005 2:29 am
Posts: 8
Hello,

I'm receiving a nullpointer Exception in the DotNode class (line 474) when doing a bulk delete. The delete statement is :

Delete Teilnetz As teilNtz where teilNtz.objektbezFremd.ttsibObj.projekt=?

The problem seems to be, that fromElement in the DotNode instance is null.

http://xml.novasib.de/nullpointer_dotnode.gif

Hibernate version:
Hibernate 3.1 beta 2

Mapping documents:
<class name="SuperObjekt" table="SUPER_OBJEKT">
<id name="id" type="java.lang.String" column="ID">
<generator class="uuid.hex"/>
</id>
...
<bag batch-size="5" cascade="none" name="objektbezFremd" inverse="true">
<key column="FREMD_ID" not-null="true"/>
<one-to-many class="Objektbez"/>
</bag>
...
<joined-subclass name="Teilnetz" table="TEILNETZ">
...
</joined-subclass>
<joined-subclass name="TtsibObjekt" table="TTSIB_OBJEKT">
...
<many-to-one name="projekt" class="Projekt" not-null="false">
<column name="PROJEKT_ID"/>
</many-to-one>
...
</joined-subclass>
</class>

<class name="Objektbez" table="OBJEKTBEZ">
...
<many-to-one name="ttsibObj" class="TtsibObjekt" not-null="true">
<column name="TTSIB_OBJ_ID"/>
</many-to-one>
...
</class>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
java.lang.NullPointerException
at org.hibernate.hql.ast.tree.DotNode.getColumns(DotNode.java:97)
at org.hibernate.hql.ast.tree.DotNode.initText(DotNode.java:210)
at org.hibernate.hql.ast.tree.DotNode.dereferenceEntityIdentifier(DotNode.java:491)
at org.hibernate.hql.ast.tree.DotNode.dereferenceEntity(DotNode.java:311)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:194)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:94)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:90)
at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:624)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1203)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4010)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3487)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1746)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:764)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:413)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:233)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:214)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:154)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:101)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:468)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1025)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1006)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)
at de.novasib.ttsib5.ebff.impl.TTSIBObjektCleanerBatchImpl$2.deleteTeilnetz(TTSIBObjektCleanerBatchImpl.java:196)
at de.novasib.ttsib5.ebff.impl.TTSIBObjektCleanerBatchImpl$2.doInHibernate(TTSIBObjektCleanerBatchImpl.java:139)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:312)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:288)
at de.novasib.ttsib5.ebff.impl.TTSIBObjektCleanerBatchImpl.cleanByProjekt(TTSIBObjektCleanerBatchImpl.java:202)
at de.novasib.ttsib5.ebff.impl.ProjektKillerImpl.killProjekt(ProjektKillerImpl.java:62)
at de.novasib.test.ttsib5.ebff.impl.ProjektKillerImplTest.testKiller(ProjektKillerImplTest.java:55)
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:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Name and version of the database you are using:
HSQLDB 1.8.1

The generated SQL (show_sql=true):
<none>

Debug level Hibernate log excerpt:
2005-09-05 11:40:17,167 DEBUG showHqlAst() --- HQL AST ---
\-[DELETE] 'Delete'
+-[FROM] 'FROM'
| \-[RANGE] 'RANGE'
| +-[DOT] '.'
| | +-[DOT] '.'
| | | +-[DOT] '.'
| | | | +-[DOT] '.'
| | | | | +-[DOT] '.'
| | | | | | +-[IDENT] 'de'
| | | | | | \-[IDENT] 'novasib'
| | | | | \-[IDENT] 'ttsib5'
| | | | \-[IDENT] 'hbm'
| | | \-[IDENT] 'SYSADM5'
| | \-[IDENT] 'Teilnetz'
| \-[ALIAS] 'teilNtz'
\-[WHERE] 'where'
\-[EQ] '='
+-[DOT] '.'
| +-[DOT] '.'
| | +-[DOT] '.'
| | | +-[IDENT] 'teilNtz'
| | | \-[IDENT] 'objektbezFremd'
| | \-[IDENT] 'ttsibObj'
| \-[IDENT] 'projekt'
\-[PARAM] '?'
- org.hibernate.hql.ast.QueryTranslatorImpl.showHqlAst(QueryTranslatorImpl.java:248)
2005-09-05 11:40:17,167 DEBUG throwQueryException() throwQueryException() : no errors - org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:68)
2005-09-05 11:40:17,167 DEBUG beforeStatement() delete << begin [level=1, statement=delete] - org.hibernate.hql.antlr.HqlSqlBaseWalker.beforeStatement(HqlSqlBaseWalker.java:105)
2005-09-05 11:40:17,167 DEBUG doInitialize() FromClause{level=1} : de.novasib.ttsib5.hbm.SYSADM5.Teilnetz (teilNtz) -> teilnetz0_ - org.hibernate.hql.ast.tree.FromElement.doInitialize(FromElement.java:103)
2005-09-05 11:40:17,167 DEBUG setResolved() Resolved : teilNtz -> teilnetz0_.ID - org.hibernate.hql.ast.tree.FromReferenceNode.setResolved(FromReferenceNode.java:51)
2005-09-05 11:40:17,183 DEBUG getDataType() getDataType() : objektbezFremd -> org.hibernate.type.BagType(de.novasib.ttsib5.hbm.SYSADM5.SuperObjekt.objektbezFremd) - org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:530)
2005-09-05 11:40:17,183 DEBUG createEntityAssociation() createEntityAssociation() : One to many - path = teilNtz.objektbezFremd role = de.novasib.ttsib5.hbm.SYSADM5.SuperObjekt.objektbezFremd associatedEntityName = de.novasib.ttsib5.hbm.SYSADM5.Objektbez - org.hibernate.hql.ast.tree.FromElementFactory.createEntityAssociation(FromElementFactory.java:351)
2005-09-05 11:40:17,183 DEBUG doInitialize() FromClause{level=1} : de.novasib.ttsib5.hbm.SYSADM5.Objektbez (no alias) -> objektbezf1_ - org.hibernate.hql.ast.tree.FromElement.doInitialize(FromElement.java:103)
2005-09-05 11:40:17,183 DEBUG addJoinByPathMap() addJoinByPathMap() : teilNtz.objektbezFremd -> SYSADM5.OBJEKTBEZ objektbezf1_ - org.hibernate.hql.ast.tree.FromClause.addJoinByPathMap(FromClause.java:218)
2005-09-05 11:40:17,183 DEBUG dereferenceCollection() dereferenceCollection() : Created new FROM element for teilNtz.objektbezFremd : SYSADM5.OBJEKTBEZ objektbezf1_ - org.hibernate.hql.ast.tree.DotNode.dereferenceCollection(DotNode.java:254)
2005-09-05 11:40:17,183 DEBUG setResolved() Resolved : teilNtz.objektbezFremd -> . - org.hibernate.hql.ast.tree.FromReferenceNode.setResolved(FromReferenceNode.java:51)
2005-09-05 11:40:17,183 DEBUG getDataType() getDataType() : ttsibObj -> org.hibernate.type.ManyToOneType(de.novasib.ttsib5.hbm.SYSADM5.TtsibObjekt) - org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:530)
2005-09-05 11:40:17,214 ERROR reportError() illegal syntax near collection: ttsibObj - org.hibernate.hql.ast.ErrorCounter.reportError(ErrorCounter.java:33)
2005-09-05 11:40:17,214 DEBUG reportError() illegal syntax near collection: ttsibObj - org.hibernate.hql.ast.ErrorCounter.reportError(ErrorCounter.java:28)
illegal syntax near collection: ttsibObj
at org.hibernate.hql.ast.tree.DotNode.checkLhsIsNotCollection(DotNode.java:474)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:193)
at org.hibernate.hql.ast.tree.DotNode.resolveFirstChild(DotNode.java:139)
at org.hibernate.hql.ast.HqlSqlWalker.lookupProperty(HqlSqlWalker.java:394)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.addrExpr(HqlSqlBaseWalker.java:4294)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1199)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4010)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3487)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1746)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:764)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.deleteStatement(HqlSqlBaseWalker.java:413)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:233)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:214)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:154)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:101)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:468)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1025)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1006)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:89)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.