You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Petres <mi...@innovobjx.com> on 2002/09/07 01:31:10 UTC

Where to place JAR file???

Hello,

I have a problem that is probably silly if you know tomcat well…

I have configured tomcat to load a context (eBMF). In order to avoid loading
the servlet twice I have set the ‘appBase’ in the server.xml file to an
empty string and I have placed the applet related stuff in a directory at
the same level as the default ‘webapps’, but called eBMF. This directory now
has /WEB-INF/classes and /WEB-INF/lib in it.

The servlet code itself resides in server.jar and is placed in
eBMF/WEB-INF/lib. I am using an HTML page with an embedded <object> tag to
load the applet (packaged in applet.jar) that will interact with the
servlet. Both applet and servlet use stuff in a third jar, library.jar.

My serlvet context is started by tomcat without problems as long as
server.jar and library.jar are in eBMF/WEB-INF/lib, as expected…
In order to run the applet I however must place the applet.jar and
library.jar in the eBMF directory and use the following parameter on the
<object> tag ‘<PARAM NAME = "ARCHIVE" VALUE = "applet.jar, library.jar">.

I would for obvious reasons like to keep all my jars in eBMF/WEB-INF/lib,
for one to avoid having multiple copies of the same jar file under the
directory structure. The browser is unable to gain access to applet.jar if
it is moved from the context base, eBMF to eBMF/WEB-INF/lib, regardless of
the way I sepecify the archive parameter in the html page, e.g. I tried
‘<PARAM NAME = "ARCHIVE" VALUE = "WEB-INF/lib/applet.jar,
WEB-INF/lib/library.jar">’. But it won’t work!

Is there some configuration issue I am missing here? Obviously Tomcat will
ensure the proper context to the servlet base, which is eBMF, but why can
files NOT be accessed in directories under it?


Michael Petres
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
InnovObjX Corp.
Web: www.innovobjx.com
Tel: 905-729-2235 x3
Fax: 905-729-2235
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Re: Where to place JAR file???

Posted by Ben Walding <be...@walding.com>.
Anything under WEB-INF is invisible to a web user, it's just the way 
things are.
Hence, I believe that you are going to need to put the library.jar in 
two places, once in the WEB-INF/lib and once in the same dir as 
applet.jar (but not under WEB-INF)

Michael Petres wrote:

>Hello,
>
>I have a problem that is probably silly if you know tomcat well&
>
>I have configured tomcat to load a context (eBMF). In order to avoid loading
>the servlet twice I have set the appBase in the server.xml file to an
>empty string and I have placed the applet related stuff in a directory at
>the same level as the default webapps, but called eBMF. This directory now
>has /WEB-INF/classes and /WEB-INF/lib in it.
>
>The servlet code itself resides in server.jar and is placed in
>eBMF/WEB-INF/lib. I am using an HTML page with an embedded <object> tag to
>load the applet (packaged in applet.jar) that will interact with the
>servlet. Both applet and servlet use stuff in a third jar, library.jar.
>
>My serlvet context is started by tomcat without problems as long as
>server.jar and library.jar are in eBMF/WEB-INF/lib, as expected&
>In order to run the applet I however must place the applet.jar and
>library.jar in the eBMF directory and use the following parameter on the
><object> tag <PARAM NAME = "ARCHIVE" VALUE = "applet.jar, library.jar">.
>
>I would for obvious reasons like to keep all my jars in eBMF/WEB-INF/lib,
>for one to avoid having multiple copies of the same jar file under the
>directory structure. The browser is unable to gain access to applet.jar if
>it is moved from the context base, eBMF to eBMF/WEB-INF/lib, regardless of
>the way I sepecify the archive parameter in the html page, e.g. I tried
><PARAM NAME = "ARCHIVE" VALUE = "WEB-INF/lib/applet.jar,
>WEB-INF/lib/library.jar">. But it wont work!
>
>Is there some configuration issue I am missing here? Obviously Tomcat will
>ensure the proper context to the servlet base, which is eBMF, but why can
>files NOT be accessed in directories under it?
>
>
>Michael Petres
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>InnovObjX Corp.
>Web: www.innovobjx.com
>Tel: 905-729-2235 x3
>Fax: 905-729-2235
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>  
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>