-->
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: NullPointerException while opening a session
PostPosted: Mon Oct 29, 2007 10:35 am 
Newbie

Joined: Tue Oct 16, 2007 3:42 pm
Posts: 11
Hi,

I am trying to debug a problem where I get a NullPointerException when the following line of code executes:

session = sessionFactory.openSession();:

The sessionFactory is null.

The scenario is that the above code does work successfully, as long as I do not add a few new POJOs with hibernate annotations implementing parent-child relationships among my new POJOs.

I have done the following debugging.

In my new .ear file (with the NullPointer), manually removed the .har file (with my new POJOs and mapping files) and in place of it, I put the .har from the old .ear file (which works successfully). My result was that the NullPointer went away, confirming that there is something in my new .har file, in particular the mappings in it which are causing the NullPointer.

I have checked my annotations and mappings, and compared them with the one-to-many examples online and in a hibernate book, and I think they are correct.

My question was that... is there possibly some simple concept in my above explanation that I am probably missing in the picture which is causing the exception?

Any suggestions will be helpful. thanks!!


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.