You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Raju Balugu <ra...@gmail.com> on 2006/08/25 17:30:54 UTC
Webapps loading sequence
Hi All,
While starting the tomcat ,I could see the webapps context loading.I would
like to know the process which one load first among the webapps
ex: I have 4 webapps which one is going to load first among them?
One more doubt
I have the 10 webapplications ,most of the apps are using the log4j
1.1.3and 1 app are going to use the log4j
1.2.12.(kept the log4j under corresponding WEB-INF/lib)(new apps).I am
loading the log4j.jar(1.1.3) in shared.loader.I am trying to launch the new
application ,I am getting the error on log4j (its clashing).If I refer the
new log4j.jar(1.2.12)..working fine but its giving the problem for other
apps due to the lower version of log4j.
Experts please suggest me, how to avoid this problem?
Regards
Raju
Re: Webapps loading sequence
Posted by David Smith <dn...@cornell.edu>.
Shankar Unni wrote:
> Raju Balugu wrote:
>
>> So,On which basis it will load that?(For example Alphabetical ..etc)
>
>
> What MarkT said.
>
> Tomcat will load the webapps in whatever order it gets them from
> File.listFiles() (which is *not* guaranteed alphabetical!), and then
> during shutdown, it unloads them in some internal hashtable values()
> order.
>
> Short answer: you cannot rely on any order during startup *or*
> shutdown. In particular, shutdown order != reverse(startup order).
>
> Longer answer: if you want a **non-portable** solution that guarantees
> order, you have to write your own wrapper around the Embedded class
> and write the deployment routine yourself. That's what I have done
> for our product which uses an embedded Tomcat to bring up a collection
> of webapps.
>
>
> ---------------------------------------------------------------------
> 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
>
And of course in a normal production environment it's perfectly
reasonable for a singular webapp to be shutdown and restarted via the
manager webapp while everything else continues. Best practice is to
provide a means of handling the case where the other webapp isn't
available even on a temporary basis.
--David
---------------------------------------------------------------------
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: Webapps loading sequence
Posted by Shankar Unni <sh...@netscape.net>.
Raju Balugu wrote:
> So,On which basis it will load that?(For example Alphabetical ..etc)
What MarkT said.
Tomcat will load the webapps in whatever order it gets them from
File.listFiles() (which is *not* guaranteed alphabetical!), and then
during shutdown, it unloads them in some internal hashtable values() order.
Short answer: you cannot rely on any order during startup *or* shutdown.
In particular, shutdown order != reverse(startup order).
Longer answer: if you want a **non-portable** solution that guarantees
order, you have to write your own wrapper around the Embedded class and
write the deployment routine yourself. That's what I have done for our
product which uses an embedded Tomcat to bring up a collection of webapps.
---------------------------------------------------------------------
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: Webapps loading sequence
Posted by Mark Thomas <ma...@apache.org>.
Raju Balugu wrote:
> Thanks David .
>
> So,On which basis it will load that?(For example Alphabetical ..etc)My
> requirement is need to load x context and then only needs to load Y
> Context.Even I am ready to change tomcat code also to meet my
> requirement?please suggest me .
Any solution that relies solely on the order the webapps are loaded is
not going to be portable between containers.
The current delpoyment order is determined by the deployApps() method
in
http://svn.apache.org/repos/asf/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/HostConfig.java
A more portable solution would be to check for the existence of a
dependant context and refuse requests until it exists.
Mark
---------------------------------------------------------------------
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: Webapps loading sequence
Posted by Raju Balugu <ra...@gmail.com>.
Thanks David .
So,On which basis it will load that?(For example Alphabetical ..etc)My
requirement is need to load x context and then only needs to load Y
Context.Even I am ready to change tomcat code also to meet my
requirement?please suggest me .
Regards
Raju
On 8/25/06, David Smith <dn...@cornell.edu> wrote:
>
> There is no guarantee of load order. A fair number of people have asked
> if it was possible and the answer has always been no.
>
> I believe (if I've read past threads correctly) best practice is to be
> sure the proper log4j.jar is in each WEB-INF/lib, removed from
> common/lib and shared/lib, added to server/lib for tomcat's own logging
> (if using a version that implements log4j for logging).
>
> --David
>
> Raju Balugu wrote:
>
> > Hi All,
> >
> > While starting the tomcat ,I could see the webapps context loading.I
> > would
> > like to know the process which one load first among the webapps
> >
> > ex: I have 4 webapps which one is going to load first among them?
> >
> > One more doubt
> > I have the 10 webapplications ,most of the apps are using the log4j
> > 1.1.3and 1 app are going to use the log4j
> > 1.2.12.(kept the log4j under corresponding WEB-INF/lib)(new apps).I am
> > loading the log4j.jar(1.1.3) in shared.loader.I am trying to launch
> > the new
> > application ,I am getting the error on log4j (its clashing).If I refer
> > the
> > new log4j.jar(1.2.12)..working fine but its giving the problem for other
> > apps due to the lower version of log4j.
> > Experts please suggest me, how to avoid this problem?
> >
> > Regards
> > Raju
> >
>
>
> ---------------------------------------------------------------------
> 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: Webapps loading sequence
Posted by David Smith <dn...@cornell.edu>.
There is no guarantee of load order. A fair number of people have asked
if it was possible and the answer has always been no.
I believe (if I've read past threads correctly) best practice is to be
sure the proper log4j.jar is in each WEB-INF/lib, removed from
common/lib and shared/lib, added to server/lib for tomcat's own logging
(if using a version that implements log4j for logging).
--David
Raju Balugu wrote:
> Hi All,
>
> While starting the tomcat ,I could see the webapps context loading.I
> would
> like to know the process which one load first among the webapps
>
> ex: I have 4 webapps which one is going to load first among them?
>
> One more doubt
> I have the 10 webapplications ,most of the apps are using the log4j
> 1.1.3and 1 app are going to use the log4j
> 1.2.12.(kept the log4j under corresponding WEB-INF/lib)(new apps).I am
> loading the log4j.jar(1.1.3) in shared.loader.I am trying to launch
> the new
> application ,I am getting the error on log4j (its clashing).If I refer
> the
> new log4j.jar(1.2.12)..working fine but its giving the problem for other
> apps due to the lower version of log4j.
> Experts please suggest me, how to avoid this problem?
>
> Regards
> Raju
>
---------------------------------------------------------------------
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