Announcement Announcement Module
No announcement yet.
Hibernate Config (hibernate.hbm.xml) outside JAR Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate Config (hibernate.hbm.xml) outside JAR

    Hi Everyone, I have a java deskstop application developed in Netbeans 6, with multiple layers, In dataaccess layer I have the applicationcontext.xml and the hibernate.cfg.xml; the problem is that hibernate configuration is read inside the jar but I want to put this file outside the jar to change easily the database connection etc etc; I tried changing the property

    [property name="configLocation"]



    but I still receive the FileNotFound exception; any suggestion to made this possible? Or is not normal put the hibernate file as an external resource for spring?

    Salu2 desde Ecuador


  • #2
    First of all use code tags.

    Next, read spring refernece guide chapter for about resources.
    If you do not want to have your file inside jar or inside folder which is on classpath you can not use "classpath" prefix.
    You can use URL of file.
    For details take a look at chapter 4