> From: Vivek Mohan [mailto:[EMAIL PROTECTED] 
> Subject: Re: How to deploy my webapp as root context webapp 
> without tomcat loading it twice?
> 
> I've kept myWebapp at ${CATALINA.HOME}/myWebapp and given this path in
> server.xml for the root context. Is that the correct way to do it? Is
> there anything in my webapp that I need to take care of when I do
> this?

That's an odd place to put a webapp.  If you don't want to put the
default app in webapps/ROOT, then I think it would be much easier to
deal with if you keep it completely outside of the Tomcat directory
structure.  Throwing things into arbitrary places just seems a bit risky
with regard to future maintenance and upgrades.

Tomcat will deploy webapps found by three mechanisms (that I know of):

1) Subdirectories of webapps or .war files in webapps.  The app name is
defined by the name of the subdirectory or .war file.  A <Context> tag
may be placed in META-INF/context.xml, if desired, but the path and
docBase attributes must not be used.

2) <app_name>.xml files containing a <Context> tag in the
conf/Catalina/<host_name> directory.  The app name is defined by the
name of the .xml file.  The <Context> tag must include a docBase
attribute that provides the location of the webapp.  I don't know what
happens if there are zero or multiple <Context> tags in the file or if
the docBase attribute is missing.

3) <Context> entries in server.xml (strongly discouraged these days).
The app name is taken from the path attribute, and this is the only time
a path attribute is allowed.  The docBase attribute specifies the
location of the app.

Sounds like you want to use the second option, using ROOT.xml to hold
your <Context> tag.

Double deployment is almost always the result of having the app defined
by more than one of the mechanisms listed above.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to