-->
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.  [ 4 posts ] 
Author Message
 Post subject: NullPointerException in Hib3.0 code
PostPosted: Tue Apr 12, 2005 10:49 am 
Beginner
Beginner

Joined: Tue Aug 10, 2004 8:59 am
Posts: 47
I have somehow managed to make hibernate crash with the NPE below. Hibernate tries to carry out the following code:
throw new MappingException("entity pojo class not found: " + entity.getEntityName(), cnfe);

But for some reason the variable "entity" is null. Has anyone got a hint to what I could be doing wrong? Why would the parameter "entity" be null when H3 expects it not to be?

Is this a known bug?

Randahl






Caused by: java.lang.NullPointerException
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.
java:87)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntit
yPersister.java:405)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(J
oinedSubclassEntityPersister.java:87)
at org.hibernate.persister.PersisterFactory.createClassPersister(Persist
erFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
199)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1043)
at dk.rockit.puls.server.hibernate.SessionManager.initialize(SessionMana
ger.java:54)
... 83 more


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 11:54 am 
Beginner
Beginner

Joined: Tue Aug 10, 2004 8:59 am
Posts: 47
Note to the developers: The error above occured because I had declared a joined-subclass in an hbm file using a non-existing package name. I simply changed the fully qualified class name and the problem was gone.

Looking at the Hibernate code for PersistentClass.getMappedClass() I came to the conclusion that the statement shown in my previous post should have used the class name String instead of entity.getEntityName() which (as I have showed) may lead to a NPE.

Randahl


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 4:01 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
AFAIK already fixed in cvs.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 12, 2005 4:10 pm 
Beginner
Beginner

Joined: Tue Aug 10, 2004 8:59 am
Posts: 47
That 's great Max!

Thanks.

R.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.