Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 47028 invoked from network); 3 Sep 2008 14:54:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2008 14:54:49 -0000 Received: (qmail 17223 invoked by uid 500); 3 Sep 2008 14:54:26 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 17171 invoked by uid 500); 3 Sep 2008 14:54:26 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 17153 invoked by uid 99); 3 Sep 2008 14:54:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 07:54:26 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dns4@cornell.edu designates 128.253.83.142 as permitted sender) Received: from [128.253.83.142] (HELO authusersmtp.mail.cornell.edu) (128.253.83.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 14:53:28 +0000 Received: from [128.253.209.217] (dns4-endeavour.calsnet.cornell.edu [128.253.209.217]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.13.1/8.12.10) with ESMTP id m83EkTX0001199 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 3 Sep 2008 10:46:29 -0400 (EDT) Message-ID: <48BEA346.8090507@cornell.edu> Date: Wed, 03 Sep 2008 10:46:30 -0400 From: David Smith User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Problem with JNDI environment entry resources References: <0AAE5AB84B013E45A7B61CB66943C172142CEF7E3C@USEA-EXCH7.na.uis.unisys.com> <0AAE5AB84B013E45A7B61CB66943C172142CEF8434@USEA-EXCH7.na.uis.unisys.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org There's an implicit association based on the context path. myWebApp.xml in conf/Catalina/localhost is implicitly associated with the webapp myWebApp in the webapps directory, whether it be as a .war or expanded folder. Illegal may be a strong word -- it implies that tomcat will flat out reject the context when you define a docBase. If there is a docBase attribute defined, it may be ignored if there's a webapp in the webapps directory matching the context name (as defined by the *name* of the context xml file in conf/{Engine Name}/{Host name}, not the path attribute of ....). Worse, if the name of your webapp in webapps is different than the name of the context xml file in conf/{Engine Name}/{Host name}, you can get a double-deploy. Only one instance of the webapp will have the additional settings provided by the context xml file though. Best practice overall is don't specify a docBase attribute unless your webapp is outside the appBase you are deploying the application to. Some people have reasons for doing this -- like when they absolutely have to have the war file named in some specific way that doesn't match the context path. Also don't define a path attribute unless your ... element is in server.xml (absolutely NOT recommended). --David Paul Pepper wrote: >> I'll have to check the docs again. However, docBase is only legal when the webapp is stored outside of the >> appBase directory. Otherwise, you risk ending up with double deployment. >> > > I don't see docBase described that way in the docs - at this moment > I'm referring to > http://tomcat.apache.org/tomcat-6.0-doc/config/context.html. Besides, > I don't see any other documented way of associating each application > with its associated element within server.xml. > > >>> unless I named the application ROOT, which is less than ideal >>> >> That is the defined mechanism for specifying the default webapp in current Tomcat levels. >> > > That's one mechanism for specifying the ROOT application. Referring to > http://tomcat.apache.org/tomcat-6.0-doc/config/context.html, when > using individual context files under > $CATALINA_BASE/conf/[enginename]/[hostname]/: > "The default web application may be defined by using a file called > ROOT.xml." > The filename less the .xml provides the context path (/ in the case of > ROOT) and the element's docBase points to the ROOT > application. This is all in accordance with the current 6.0 docs from > my reading of them. > > I'd like to pull this out into a thread of its own on this mailing > list. Maybe we can take this discussion there. This particular problem > is of importance to me, and it would seem also to others judging by > the comments left on the bug report that I referenced in my previous > comment. > > >> Placing elements in server.xml is really only there for compatibility with older versions of Tomcat. Personally, I'd like to see it made illegal, which would put an end to many potential configuration errors. >> > > Then you'd be taking away the only mechanism (that I can see) for > pointing to an application as ROOT, without the inelegant renaming of > applications as ROOT. > > Paul. > > --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org