Results 1 to 2 of 2

Thread: Hibernate Config (hibernate.hbm.xml) outside JAR

  1. #1
    Join Date
    Oct 2007
    Posts
    3

    Question 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"]
    [value]classpath:com/miapp/hibernate/hibernate.cfg.xml[/value]

    or

    [value]classpath*.*[/value]

    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

    gishac

  2. #2
    Join Date
    Mar 2007
    Location
    Poland
    Posts
    341

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •