tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: manager webapp + ant == missing files (was: Apps Deploying to wrong dir?)
Date Wed, 30 Apr 2003 22:39:48 GMT
Hi Mike,

There is not just one possible location for your WAR files (i.e. the 
/webapps directory), but there are more of them.
Maybe this is causing the misunderstanding - the identifier "appbase 
directory" relates to how you can access the application, not where it is 
actually stored.

/webapps/ would usually contain the application if you deploy it there 
manually using FTP or if you push up a WAR file which gets extracted then.
However, every application is stored by Tomcat internally as well, inside 
the /work directory. 

To create applications which are be truly portable, you have to access any 
files inside the WAR file (e.g. properties files) using myclass
.getResourceAsStream(), not using FileInputStream etc. 

If you upload a file using the manager application it stores the WAR 
beneath the manager app work directory path. Tomcat is notified of this 
"unusual" location using the docbase attribute of the Context tag:
<Context .. 

I hope this helps,

Michael Barrett <> 
01.05.2003 00:19
Please respond to
"Tomcat Users List" <>

Tomcat Users List <>

Re: manager webapp + ant == missing files (was: Apps Deploying to wrong 

So what is telling the application to deploy it someplace else other than 
the appbase directory?  The manager documentation says it should deploy 
into the appbase directory, so I assumed that it would work as documented. 
 I'm not following why this isn't the case.

Maybe this is just due to my limited understanding of java/servlets.  ANy 
help you can give would be great, thanks.

On Tue, Apr 29, 2003 at 11:51:16PM -0500, Jacob Kjome wrote:
> It seems you are counting on Tomcat specific behavior.  There is nothing 
> the servlet spec that says that the container should extract the .war 
> and deploy from a directory.  Deploying directly from a .war file is 
> perfectly valid.  Hence, you should not count on File IO access to the 
> contents of your webapp.  Load config file using 
> context.getResourceAsStream() or use the classloader to load resources 
as a 
> stream.  This will work both within archives and within directories.
> BTW, having an appBase doesn't preclude deploying contexts outside that 
> appbase to that virtual host.  It just means that that is the default 
> to look for contexts.  It is, in fact, a convenience, not a requirement.
> Everything Tomcat is doing is perfectly fine.  You need to fix your 
> to be portable as per the servlet spec.
> Jake
> At 04:16 PM 4/29/2003 -0700, you wrote:
> >On Tue, Apr 29, 2003 at 10:17:03PM +0200, wrote:
> >> Hi Mike,
> >
> >    Hi, thanks for responding.  I have a few questions based on below- 
> >hopefully someone can answer them.
> >
> >> 1.) Deploying using the manager app always results in the WAR file 
> >showing
> >> up beneath
> >> ${CATALINA_BASE}/work/Standalone/localhost/manager/myapp:war
> >
> >    Why is this?  The document 
> >(
> >plainly states that deploy should:
> >        "Upload the web application archive (WAR) file that is 
specified as
> >         the request data in htis HTTP PUT request, install it into the
> >         appBase directory of our corresponding virtual host, and start 

> >it on
> >         the context path specified by the path request parameter."
> >
> >    I have my appbase set as 'webapps' in my Host definition in 
> >server.xml.  Is this just a bug in the documentation, or am I 
> >misunderstanding something somewhere?
> >
> >    In truth, I could deal with this inconsistency easily enough.  The 
> >larger problem I'm running into is that I have a properties file called 

> >'' in my .war in the WEB-INF subdirectory, and for 
> >some reason when I use either deploy (to actually push the War over the 

> >network) or intsall (to just install the War that is already on the 
> >server) it doesn't seem to expand that, and pretty much -all- the other 

> >files that go in WEB-INF, except for the classes and lib 
> >directory.  Needless to say, this causes problems for my code, and 
> >the manager application almost useless for me.
> >
> >    Is anyone else running into this issue?
> >
> >--
> > 
> >                Mike Barrett | "I used to read, now I go to raves."
> >    | -- Random MUNI Rider, speaking
> >     |    to my friend Allison.
> > 
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> >For additional commands, e-mail:

                Mike Barrett | "I used to read, now I go to raves."
    | -- Random MUNI Rider, speaking
     |    to my friend Allison.

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message