tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: App Initialization Order In Tomcat
Date Thu, 08 Nov 2012 02:23:55 GMT
> From: Jose H. Martinez [mailto:josehmartinezz@gmail.com] 
> Subject: Re: App Initialization Order In Tomcat

> > Make the web service war filename be alphabetically before the second
> > application war file........Eg alpha.war is the web service and beta.war is
> > the dependant application.

> This is indeed an interesting solution 

Not really - it's completely bogus.  By definition (the servlet spec), webapps are independent
of each other, so there can be no defined startup order.  The order of initialization is not
guaranteed, since it depends on factors outside of Tomcat's control, such as the order items
are encountered in the directories in server's file system.

The proper way to handle this is to use lazy initialization, so that the invocation of the
web service by the primary app happens only when the first request arrives, not during initialization
of the primary.

Although not intended for this purpose, the startStopThreads attribute of the <Host>
element can be used to work around such poor application design, by using separate threads
for each webapp.  Look here for details:

http://tomcat.apache.org/tomcat-7.0-doc/config/host.html

 - 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message