I've noticed trouble using the
Code:
<mapping jar="some-jar-file.jar" />
inside of a servlet container (e.g., Tomcat). Using a jar this way works fine for 2-tier apps: the file system resolves the resource request. The
Code:
<mapping resource="some-mapping-file.hbm.xml" />
works fine in either place. Digging into the source, I think I see why:
In net.sf.hibernate.cfg.Configuration there is a now-deprecated
Code:
addJar(String resource)
. Does anyone know why this was deprecated and (re-?)written to call the file-based addJar? The corresponding addResource(String path) is much more robust: converting the specifed path into an InputStream, which is supported by both the file system
and servlet containers.
Since there is a JarInputStream in java.util.jar I am curious, as a Hibernate newbie, why that is not used in the implementation of the addJar(String path) method.
Thanks.