/hibernate.cfg.xml not found

18 Mar

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 under src folder.

About these ads

14 Responses to “/hibernate.cfg.xml not found”

  1. mm July 29, 2008 at 7:56 pm #

    Thanks..this response helped me a lot..

  2. Ramdas December 2, 2008 at 10:53 am #

    That helped… Thanks :)

  3. arif March 19, 2009 at 1:41 am #

    it works for me.. thanks.. :)

  4. Ale April 13, 2009 at 5:30 pm #

    Thanks!!!!!!

    Its really works

  5. Rick - r2s667@hotmail.com April 25, 2009 at 4:04 am #

    Thaaaannnnnkkkkksss!!!!

    SOLVED!!!!

  6. Ayajahmed June 23, 2009 at 9:08 am #

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

  7. Michael B. July 10, 2009 at 1:30 pm #

    Great tip!!!
    Thanks.

  8. g December 8, 2009 at 8:43 pm #

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

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

  9. luke September 20, 2010 at 7:00 am #

    it’s really working

  10. click here June 4, 2012 at 10:40 am #

    While I truly like this post, I think there was an spelling error near towards the finish of the third paragraph.

    • Paras June 4, 2012 at 6:55 pm #

      Thanks for pointing out. Is it alright now?

  11. priti September 20, 2012 at 5:32 pm #

    woooooooowwwww…it worked thx :)

  12. Davis February 20, 2013 at 4:54 am #

    Where exactly did you actually pick up the tips to compose ““/hibernate.
    cfg.xml not found Techspace”? I appreciate it ,Cassandra

  13. Accutane March 24, 2013 at 12:39 pm #

    Hello, I do believe your blog could possibly be having internet
    browser compatibility problems. Whenever I look at your blog in Safari, it looks fine
    but when opening in Internet Explorer, it has some overlapping issues.
    I merely wanted to give you a quick heads
    up! Aside from that, great site!

Leave a Reply

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

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.

%d bloggers like this: