GeeCON Prague 2014*
The moose likes Object Relational Mapping and the fly likes problem getting configuration in hibernate 3.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "problem getting configuration in hibernate 3.0" Watch "problem getting configuration in hibernate 3.0" New topic
Author

problem getting configuration in hibernate 3.0

subbarao dachepalli
Greenhorn

Joined: Jul 28, 2005
Posts: 5
Hi all

I am new hibernate.I tried to do some simple program.
But i got null pointer exception.

my code is :
Configuration cfg = new Configuration().addClass(Contact.class);
System.out.println("-----c-"+cfg);
cfg.configure("/hibernate.cfg.xml");
SessionFactory sessionFactory = cfg.buildSessionFactory();
session =sessionFactory.openSession();

I am not able to get that println.(I added that println to know where exactly the null pointer exception is throwing).

can any body tell me where iam going wrong
Thanks in advamce
 
GeeCON Prague 2014
 
subject: problem getting configuration in hibernate 3.0