Re: Initializing webapps in a certain order
On 14/03/2012 01:37, Caldarale, Charles R wrote: From: Warren Bell [mailto:warrenbe...@gmail.com] Subject: Initializing webapps in a certain order Can you initialize webapps in a certain order ? Read the FAQ: http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q27 The primary reason is that the servlet spec requires that each webapp be self-contained and independent. I have two apps, app1 and app2. app2 needs to access app1 during app2's initialization. I need app1 to be initialized first and be done before app2 starts to initialize. Sounds like a bad plan. Sounds reasonable to me, that one service be designed to make use of another service ;-) We have OS services with explicit start-up dependencies, e.g. an issue tracking system which uses an RDBMS, and I'd expect to be able to do this with webapps. If the apps are so tightly coupled, why aren't they just one webapp? The dependency Warren describes doesn't imply tightly coupled, and one possible reason they aren't one webapp is that they come from different vendors. Does the servlet spec require that no web app may use the services of another web app? Is a servlet spec implementation free to enable startup sequence to be defined? Paul Singleton - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Initializing webapps in a certain order
From: Paul Singleton [mailto:p...@jbgb.com] Subject: Re: Initializing webapps in a certain order Does the servlet spec require that no web app may use the services of another web app? No that's perfectly alright. The key point of the OP's query was that he has a webapp that required the other service _during_initialization_ - thus requiring startup ordering. There's no problem at all with webapps accessing each other once initialization is complete. Is a servlet spec implementation free to enable startup sequence to be defined? Not quite sure how to parse that. If you're asking if a specific container could implement something outside of the spec to control ordering, that would certainly be possible, but also certainly against the spirit of the spec. - 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Initializing webapps in a certain order
From: Caldarale, Charles R Subject: RE: Initializing webapps in a certain order I have two apps, app1 and app2. app2 needs to access app1 during app2's initialization. I need app1 to be initialized first and be done before app2 starts to initialize. Just had a thought: Tomcat 7 has the startStopThreads config attribute for the Host element; this might let you get away with what you want to do, depending on how it's implemented. (It won't work if all initialization threads have to complete before any request processing is allowed; I haven't looked at the code to see.) - 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Initializing webapps in a certain order
On 14/03/2012 13:29, Caldarale, Charles R wrote: From: Paul Singleton [mailto:p...@jbgb.com] Subject: Re: Initializing webapps in a certain order Does the servlet spec require that no web app may use the services of another web app? No that's perfectly alright. The key point of the OP's query was that he has a webapp that required the other service _during_initialization_ + in the same container - thus requiring startup ordering. There's no problem at all with webapps accessing each other once initialization is complete. If it's an external service you can obviously manage the startup order. p Is a servlet spec implementation free to enable startup sequence to be defined? Not quite sure how to parse that. If you're asking if a specific container could implement something outside of the spec to control ordering, that would certainly be possible, but also certainly against the spirit of the spec. - 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- [key:62590808] signature.asc Description: OpenPGP digital signature
Re: Initializing webapps in a certain order
On Wed, Mar 14, 2012 at 12:50:45PM +, Paul Singleton wrote: On 14/03/2012 01:37, Caldarale, Charles R wrote: From: Warren Bell [mailto:warrenbe...@gmail.com] Subject: Initializing webapps in a certain order Can you initialize webapps in a certain order ? Read the FAQ: http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q27 The primary reason is that the servlet spec requires that each webapp be self-contained and independent. I have two apps, app1 and app2. app2 needs to access app1 during app2's initialization. I need app1 to be initialized first and be done before app2 starts to initialize. Sounds like a bad plan. Sounds reasonable to me, that one service be designed to make use of another service ;-) It's also reasonable to design a service so that it doesn't have to stall (or fail) *in the middle of startup* because a supporting service is not running yet. If they have to depend on each other, they might just start anyway, keep trying to make contact, and fire a message upon unreasonable delay. Or just return an error status (and hopefully an informative text) when dependent service A is asked for something that can't be done without the help of supporting service B which is not responding. You probably want that sort of fail-soft design anyway. That would be self-contained and independent in my book, since the app. can continue to operate and gives useful (if undesired) responses regardless of what any other app. is doing. Think of it as lazy initialization, driven by user requests instead of startup code. Startup of service or interactive programs should do only what is absolutely necessary to get the app. into a state in which it can respond, since there can be no guarantee that an arbitrary request will *ever* succeed. We have OS services with explicit start-up dependencies, e.g. an issue tracking system which uses an RDBMS, and I'd expect to be able to do this with webapps. Ah, but that's not the same mechanism. There the OS works out the dependency tree and doesn't start service A until supporting service B indicates successful startup. There's no such centralized dependency analysis in a servlet container; the app.s start in any order the container may choose and then stumble over missing dependencies. I think it could be argued that the servlet spec. makes startup ordering by the container an explicit non-requirement, so you couldn't count on it at another site or in another container version anyway. If you're going to make them dependent then you have to provide the whole dependency resolution mechanism. -- Mark H. Wood, Lead System Programmer mw...@iupui.edu Asking whether markets are efficient is like asking whether people are smart. pgpZJLaxkL0af.pgp Description: PGP signature
RE: Initializing webapps in a certain order
From: Warren Bell [mailto:warrenbe...@gmail.com] Subject: Initializing webapps in a certain order Can you initialize webapps in a certain order ? Read the FAQ: http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q27 The primary reason is that the servlet spec requires that each webapp be self-contained and independent. I have two apps, app1 and app2. app2 needs to access app1 during app2's initialization. I need app1 to be initialized first and be done before app2 starts to initialize. Sounds like a bad plan. If the apps are so tightly coupled, why aren't they just one webapp? - 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Initializing webapps in a certain order
On 3/13/12 6:37 PM, Caldarale, Charles R wrote: From: Warren Bell [mailto:warrenbe...@gmail.com] Subject: Initializing webapps in a certain order Can you initialize webapps in a certain order ? Read the FAQ: http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q27 The primary reason is that the servlet spec requires that each webapp be self-contained and independent. I have two apps, app1 and app2. app2 needs to access app1 during app2's initialization. I need app1 to be initialized first and be done before app2 starts to initialize. Sounds like a bad plan. If the apps are so tightly coupled, why aren't they just one webapp? They could eventually be on two servers, still may be a bad plan though. Thanks, Warren Bell - 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org