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!!
|