-->
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.  [ 2 posts ] 
Author Message
 Post subject: where should be the hibernate.cfg.xml in our project
PostPosted: Mon Oct 04, 2010 3:11 am 
Newbie

Joined: Mon Oct 04, 2010 3:06 am
Posts: 1
hi,

I m an novice user. I am gettin an error i this line SessionFactory sessionFactory = new
Configuration().configure().buildSessionFactory();

it is giving null pointer exception. please tell me what can be the cause. where should be the hibernate.cfg.xml in our project.

Any help will be appreciable.

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: where should be the hibernate.cfg.xml in our project
PostPosted: Wed Oct 06, 2010 4:13 pm 
Beginner
Beginner

Joined: Mon Mar 02, 2009 3:36 pm
Posts: 25
You can put hibernate.cfg.xml file anywhere you want but in that case you will have to call

Code:
SessionFactory sessionFactory = new Configuration().configure(String resource).buildSessionFactory();


where resource is the location of cfg file . But Normally app developers keep this file in the current project directory and use the configure() method having no-args.

Thanks,
Ganesh


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