You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Velja Radenkovic <ve...@gmail.com> on 2006/09/14 13:27:51 UTC
Two contexts initialized ...
Hello
I set the web application directory to be a ROOT
by creating dirname.xml
in the CATLINA_HOME/conf/Catalina/localhost
with content '<Context path="" docBase="${catalina.home}/webapps/dirname"
debug="0"/>' ...
My problem is that there are two contexts initialized now and
contextInitialized of my listener is called twice for each context once
(which is perfectly normal) ...
But I'm doing some job in contextInitialized and it gets duplicated.
How I can have some arbitrary directory deployed as ROOT i.e / and not
having two contexts deployed (other under /somedir)?
I guess that reason is that "${catalina.home}/webapps/dirname" overlaps the
webapps folder ... If I put it somwhere else not under webapps tom will
initialize it only once?
Thanks,
Velja Radenkovic
Re: Two contexts initialized ...
Posted by David Smith <dn...@cornell.edu>.
Two solutions:
1. Rename dirname to ROOT (recommended)
2. Move dirname out of webapps.
Essentially the webapp is being deployed once because of the ROOT.xml
file and once because of it's presence in webapps with a name other than
ROOT.
--David
Velja Radenkovic wrote:
> Hello
>
> I set the web application directory to be a ROOT
> by creating dirname.xml
> in the CATLINA_HOME/conf/Catalina/localhost
> with content '<Context path="" docBase="${catalina.home}/webapps/dirname"
> debug="0"/>' ...
>
> My problem is that there are two contexts initialized now and
> contextInitialized of my listener is called twice for each context once
> (which is perfectly normal) ...
> But I'm doing some job in contextInitialized and it gets duplicated.
> How I can have some arbitrary directory deployed as ROOT i.e / and not
> having two contexts deployed (other under /somedir)?
>
> I guess that reason is that "${catalina.home}/webapps/dirname"
> overlaps the
> webapps folder ... If I put it somwhere else not under webapps tom will
> initialize it only once?
>
> Thanks,
> Velja Radenkovic
>
---------------------------------------------------------------------
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
Re: Two contexts initialized ...
Posted by Velja Radenkovic <ve...@gmail.com>.
Thanks,
It is tom 5. And its OK now.
Velja
On 9/14/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
>
> > From: Velja Radenkovic [mailto:velja.radenkovic@gmail.com ]
> > Subject: Two contexts initialized ...
> >
> > I set the web application directory to be a ROOT
> > by creating dirname.xml
> > in the CATLINA_HOME/conf/Catalina/localhost
> > with content '<Context path=""
> > docBase="${catalina.home}/webapps/dirname"
> > debug="0"/>' ...
>
> You didn't bother to tell us the Tomcat version you're using, but if
> it's 5.5 or newer, remember that the path attribute must not be used
> when the <Context> element is in conf/Catalina/localhost.
>
> - 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 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
>
>
RE: Two contexts initialized ...
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Velja Radenkovic [mailto:velja.radenkovic@gmail.com]
> Subject: Two contexts initialized ...
>
> I set the web application directory to be a ROOT
> by creating dirname.xml
> in the CATLINA_HOME/conf/Catalina/localhost
> with content '<Context path=""
> docBase="${catalina.home}/webapps/dirname"
> debug="0"/>' ...
You didn't bother to tell us the Tomcat version you're using, but if
it's 5.5 or newer, remember that the path attribute must not be used
when the <Context> element is in conf/Catalina/localhost.
- 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 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