-
Sep 25th, 2008, 09:20 AM
#1
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
-
Sep 26th, 2008, 04:07 AM
#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
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
-
Forum Rules