Skip to Content
author's profile photo Former Member
Former Member

Web Dynpro: Where put hibernate hibernate.cfg.xml?

I have seen several people asking about the place to put the config file of Hibernate, but not any conclusive answer until now...

I created a external library in WAS (I verified using Visual Admin that the lib was correctly deployed). In my Web Dynpro References -> Library Reference I add the library in the format Provider Name/Library Name: ""

<b> Where can I store the hibernate.cfg.xml?</b> I have tried put it in all web dynpro folders!


Ivan Garcia

From Brazil

<b> This is my source code:</b>

Configuration cfg = new Configuration();


<b> The error:</b>

org.hibernate.HibernateException: hibernate.conf.xml not found

at org.hibernate.util.ConfigHelper.getResourceAsStream(

at org.hibernate.cfg.Configuration.getConfigurationInputStream(

at org.hibernate.cfg.Configuration.configure(

I have read all forum topics about this, including:

Where to put config files in webdynpro ?

Problem in placing hibernate.cfg.xml



How to add external jar in web dynpro without going for DC

Web Dynpro References

Using External Library in Web Dynpro - Error

Deploy external jar to WAS 6.40

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 02:47 AM


    Did you try to put this file right under src/packages?

    If so, please check whether or not it get included in EAR/JAR after build.

    Also try to rename it to hibernate.cfg.hbml and use cfg.configure("hibernate.conf.hbml") -- some NW IDE resist to include files with xml extension, so it's necessary to fake them.

    Valery Silaev

    SaM Solutions

    Message was edited by:

    Valery Silaev

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 11, 2007 at 02:33 PM


    I've faced with this error and I solved using the following way:

    1 - Create a DC library Project - Put the hibernat's jar files at this project and create a public part. Don't forget to create an assembly and build component.

    2 - Create a DC Java Projet - Put all Hibernat classes at this project (POJOS, Comands and Utils) and the library project as "used DC". Put the hibernate.cfg.xml over the src/package folder. Create a public part.

    3 - Create a DC Web Dynpro - Add the hibernate and java project as used DC.

    Create a Java Bean Model and create the applications. In your web dynpro code, just call the Commands classes.

    Build the web dynpro DC and do its deploy!

    At this way will work fine.



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.