-->
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.  [ 3 posts ] 
Author Message
 Post subject: NullPointer Exception in many to one relation
PostPosted: Fri May 12, 2006 2:31 am 
Newbie

Joined: Fri May 12, 2006 2:18 am
Posts: 2
Hi !
I have two tables with one to many inverse mapping.
Parent and Child
Through ParentManager.java, I have successfully inserted a child int db using statement like parent.addChild()

now I am writing ChildManager and want to write a method to get list of all child tuples in tables
and currently I am doing
String SQL_STRING = "FROM Child";
Query query = session.createQuery(SQL_STRING);
ArrayList list = (ArrayList)query.list();

When I run this method I get an error message like
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
java.lang.NullPointerException
at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372)
at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:891)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:859)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.EntityType.resolve(EntityType.java:303)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1129)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at au.com.home.hibernate.manager.Manager.getChilds(Manager.java:83)
at au.com.home.client.Client.main(Client.java:11)
Exception in thread "main"
Java Result: 1
I would appreciate any hints or suggestions


Top
 Profile  
 
 Post subject: Re:NullPointer Exception in many to one relation
PostPosted: Wed May 17, 2006 7:54 am 
Newbie

Joined: Wed May 17, 2006 7:50 am
Posts: 1
I had the same problem when migrating from 3.0 to 3.2.
In my case, it turned out to be caused by asm.jar and asm-attrs.jar not being in the class path.

If that doesn't do it, configure log4j and check the log.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 17, 2006 7:13 pm 
Newbie

Joined: Fri May 12, 2006 2:18 am
Posts: 2
Vula !
only If I knew that this will solve the problem before.... thankx for your reply


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

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.