Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate

 
Sree Kumari
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a simple application using hibernet .when I try to run it iam getting the error as

/hibernate.cfg.xml not found
java.lang.NullPointerException
at test.hiber.FirstExample.main(FirstExample.java:33)
Exception in thread "main" .
I am keeping the cfg file in the classpath itself.The Configaration object is not created.
 
Divan Mostert
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to instantiate your own Configuration and then configure it:

Gonfiguration cfg = new Configuration();
cfg.configure("your hibernate.cfg.xml");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic