Hello,
I have encountered following inconvenience: In my hibernate.cfg.xml I have a statement:
Code:
<mapping jar="mylibrary.jar" />
It looks that Hibernate searches for this file in server's working directory (I use Tomcat 6). It would be nice if I could specify this path relative to my application's WEB-INF directory.
Now, as far as I have researched this, the only way to specify this file is writing absolute path, what is very annoying if you deploy the application to several enviroinments.
My question is: Is there any solution to make Hibernate search for this jars relatively to application deploy directory?
Hibernate version: 3.2.5 Debug level Hibernate log excerpt:Code:
2007-10-15 15:40:37,479 DEBUG - null<-org.dom4j.tree.DefaultAttribute@1e3d24a [Attribute: name jar value "mylibrary.jar"]
2007-10-15 15:40:37,479 INFO - Searching for mapping documents in jar: mylibrary.jar
Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not read mapping documents from jar: mylibrary.jar
...
...
Caused by: org.hibernate.InvalidMappingException: Could not read mapping documents from jar: mylibrary.jar
at org.hibernate.cfg.Configuration.addJar(Configuration.java:607)
...
...
... 33 more
Caused by: java.io.FileNotFoundException: mylibrary.jar (Nie można odnaleźć określonego pliku)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.hibernate.cfg.Configuration.addJar(Configuration.java:604)
... 40 more