These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping files in jar
PostPosted: Mon Oct 15, 2007 9:54 am 
Beginner
Beginner

Joined: Mon Feb 19, 2007 4:22 am
Posts: 22
Location: Poland
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.