Techspace

IT happens only in IT

/hibernate.cfg.xml not found

Problem: Many a times we get a problem in hibernate saying /hibernate.cfg.xml not found

Solution: As per Java Persistence with Hibernate book, you should keep the hibernate configuration file directly in the source directory of your project outside any package. In Rational Application Developer, I have solved this problem by placing it directly src folder.

Advertisement

March 18, 2007 - Posted by | Hibernate

9 Comments »

  1. Thanks..this response helped me a lot..

    Comment by mm | July 29, 2008 | Reply

  2. That helped… Thanks :)

    Comment by Ramdas | December 2, 2008 | Reply

  3. it works for me.. thanks.. :)

    Comment by arif | March 19, 2009 | Reply

  4. Thanks!!!!!!

    Its really works

    Comment by Ale | April 13, 2009 | Reply

  5. Thaaaannnnnkkkkksss!!!!

    SOLVED!!!!

    Comment by Rick - r2s667@hotmail.com | April 25, 2009 | Reply

  6. Thanks Man….This was a great Help!!!!

    Comment by Ayajahmed | June 23, 2009 | Reply

  7. Great tip!!!
    Thanks.

    Comment by Michael B. | July 10, 2009 | Reply

  8. Another solution is to change the SessionFactory creation in HibernateUtil.java

    pathToHibernateCfg = “hibernate/resources/hibernate.cfg.xml”;
    return new Configuration().configure(pathToHibernateCfg).buildSessionFactory();

    Comment by g | December 8, 2009 | Reply

  9. it’s really working

    Comment by luke | September 20, 2010 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.