• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

/hibernate.cfg.xml not found

 
kamal krishna bhatt
Ranch Hand
Posts: 41
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i am executing a jar which uses hibernate i have put hibernate.cfg.xml file in the same directory where i am executing jar but it is giving exception /hibernate.cfg.xml not found i have explicitly defined its path new Configuration().configure("path"),also i have put it inside jar but still not working .following is the stack trace-
Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found
Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
at org.one97.nms.fe.util.HibernateUtil.<clinit>(HibernateUtil.java:20)
at org.one97.nms.fe.event.LastCallTime.getHibernateSession(LastCallTime.java:539)
at org.one97.nms.fe.event.LastCallTime.getNodes(LastCallTime.java:269)
at org.one97.nms.fe.event.LastCallTime.run(LastCallTime.java:112)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:2176)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2157)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
at org.one97.nms.fe.util.HibernateUtil.<clinit>(HibernateUtil.java:13)
... 4 more
 
Rob Spoor
Sheriff
Pie
Posts: 20753
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our ORM forum.
 
Waswani Naresh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kamal,

Just make sure that hibernate.cfg.xml is in the class path.

Regards,
Naresh Waswani
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic