So what would be the correct way to include jar file? In my case when developing I have the path:
Code:
/home/user/src/project/build/web/WEB-INF/lib/core.jar
When the project will be deployed on a production server, it might be in:
Code:
/var/lib/tomcat-5/default/webapps/project/WEB-INF/lib/core.jar
or
Code:
/opt/tomcat5.5/webapps/servlets-examples/WEB-INF/lib/core.jar
or
Code:
C:\somepath\...
on Windows.
So in my case the core.jar file is placed in
/context/WEB-INF/lib/core.jar but hibernate searches relative path from
/opt/tomcat5.5/shared/lib.
I cannot specify absolute path to the core.jar file because it won't work in all these possible environments. If I specify relative path, it won't work either. The only thing I know is where the file is placed in my context but I don't know how to specify in the persistence.xml that EMF should search the directory
WEB-INF/lib in my context and not
/opt/tomcat5.5/shared/lib.
Quote:
<jar-file> is considered portable in an EJB3 container, not outside.
Could you please explain me how can I set portable path to the jar file in my case? I am very new to java, hibernate and Tomcat so I might be missing something important that prevents me from understanding it.
Thank you for your help.