You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eric Bouer <er...@gmail.com> on 2011/09/19 09:45:41 UTC

Display a static page while application loading.

Hello list.
I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
The spring container and hibernate bootstrap are slow and the users get a
blank page or no response from tomcat while the application starts.
In order to avoid that I was thinking about some static page that can be
served by a different thread but the problem is that there are muiltiple
wars and I wish to have a simple solution.

I'd like to know if Tomcat already provides a solution for this problem or
if it is a planned feature request (couldn't find any)
Or is there another way to solve this issue?
Thanks.


-- 
View this message in context: http://old.nabble.com/Display-a-static-page-while-application-loading.-tp32493013p32493013.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Display a static page while application loading.

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
 On Mon, 19 Sep 2011 07:50:50 -0700 (PDT), Eric Bouer wrote:
> Yeah but high availability/scaling solutions or a dynamic nature of
> application where new features are added frequently are common.
> Anyway if I could get some information on tomcat internal bootstap I 
> would
> write something to handle that and contribute it back.

 In other words, you need some kind of a mechanism, that notifies other 
 pieces of application, that particular component is ready to serve 
 requests? Is that correct?

-- 
 Mikolaj Rydzewski <mi...@ceti.pl>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Display a static page while application loading.

Posted by Pid <pi...@pidster.com>.
On 19/09/2011 16:52, David kerber wrote:
> On 9/19/2011 10:50 AM, Eric Bouer wrote:
>>
>> Yeah but high availability/scaling solutions or a dynamic nature of
>> application where new features are added frequently are common.
> 
> HA and scaling solutions typically employ a load balancer (i.e. Apache
> HTTPD) in front of them which could handle this.

+1

It would seem to be contradictory to the expectations of HA send traffic
to an application which hasn't started yet.


p





Re: Display a static page while application loading.

Posted by David kerber <dc...@verizon.net>.
On 9/19/2011 10:50 AM, Eric Bouer wrote:
>
> Yeah but high availability/scaling solutions or a dynamic nature of
> application where new features are added frequently are common.

HA and scaling solutions typically employ a load balancer (i.e. Apache 
HTTPD) in front of them which could handle this.  I don't think true 
production apps have new features added frequently enough for this to be 
an issue.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Display a static page while application loading.

Posted by Eric Bouer <er...@gmail.com>.
Yeah but high availability/scaling solutions or a dynamic nature of
application where new features are added frequently are common.
Anyway if I could get some information on tomcat internal bootstap I would
write something to handle that and contribute it back.


CRANFORD, CHRIS wrote:
> 
> Eric -
> 
> One could argue what's the true benefit here though?  Production shouldn't
> be restarted or unavailable except during an outage, whether it's planned
> or unplanned, right?
> 
> -----Original Message-----
> From: Eric Bouer [mailto:ericbouer@gmail.com] 
> Sent: Monday, September 19, 2011 6:46 AM
> To: users@tomcat.apache.org
> Subject: Re: Display a static page while application loading.
> 
> 
> Thanks you Francis but I can't use a apache frontend.
> I'm looking for a solution in tomcat itself, And I guess it's a common
> request since many applications have long startup times and this can be
> very annoying to get a blank page in production.
> 
> 
> 
> Francis Galiegue-4 wrote:
>> 
>> On Mon, Sep 19, 2011 at 09:45, Eric Bouer <er...@gmail.com> wrote:
>>>
>>> Hello list.
>>> I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
>>> The spring container and hibernate bootstrap are slow and the users 
>>> get a blank page or no response from tomcat while the application
>>> starts.
>>> In order to avoid that I was thinking about some static page that can 
>>> be served by a different thread but the problem is that there are 
>>> muiltiple wars and I wish to have a simple solution.
>>>
>>> I'd like to know if Tomcat already provides a solution for this 
>>> problem or if it is a planned feature request (couldn't find any) Or 
>>> is there another way to solve this issue?
>>> Thanks.
>>>
>> 
>> With Tomcat alone, no idea. I do that with Apache in front of Tomcat, 
>> but this requires that Tomcat be set up in a particular way.
>> 
>> Here is what happens here when a webapp is started:
>> 
>> * Apache is configured to display a static page for the corresponding 
>> server name and path;
>> * I use Tomcat's manager webapp to deploy the new context;
>> * on success, Apache is reconfigured to forward requests and its 
>> configuration reloaded.
>> 
>> For this, Tomcat is started with only the manager webapp, and only in 
>> text mode from localhost. Contexts are then deployed and undeployed on 
>> demand. One problem with Tomcat is that the bundled startup scripts 
>> will return _before_ Tomcat is fully bootstrapped, which is why I have 
>> to use my own. This has been discussed at length a few months ago, and 
>> is why I have my current setup. It is the only way for me to have the 
>> behavior I seek.
>> 
>> --
>> Francis Galiegue
>> ONE2TEAM
>> Ingénieur système
>> Mob : +33 (0) 683 877 875
>> Tel : +33 (0) 178 945 552
>> fge@one2team.com
>> 40 avenue Raymond Poincaré
>> 75116 Paris
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> --
> View this message in context:
> http://old.nabble.com/Display-a-static-page-while-application-loading.-tp32493013p32494281.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Display-a-static-page-while-application-loading.-tp32493013p32495720.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Display a static page while application loading.

Posted by "CRANFORD, CHRIS" <Ch...@setech.com>.
Eric -

One could argue what's the true benefit here though?  Production shouldn't be restarted or unavailable except during an outage, whether it's planned or unplanned, right?

-----Original Message-----
From: Eric Bouer [mailto:ericbouer@gmail.com] 
Sent: Monday, September 19, 2011 6:46 AM
To: users@tomcat.apache.org
Subject: Re: Display a static page while application loading.


Thanks you Francis but I can't use a apache frontend.
I'm looking for a solution in tomcat itself, And I guess it's a common request since many applications have long startup times and this can be very annoying to get a blank page in production.



Francis Galiegue-4 wrote:
> 
> On Mon, Sep 19, 2011 at 09:45, Eric Bouer <er...@gmail.com> wrote:
>>
>> Hello list.
>> I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
>> The spring container and hibernate bootstrap are slow and the users 
>> get a blank page or no response from tomcat while the application starts.
>> In order to avoid that I was thinking about some static page that can 
>> be served by a different thread but the problem is that there are 
>> muiltiple wars and I wish to have a simple solution.
>>
>> I'd like to know if Tomcat already provides a solution for this 
>> problem or if it is a planned feature request (couldn't find any) Or 
>> is there another way to solve this issue?
>> Thanks.
>>
> 
> With Tomcat alone, no idea. I do that with Apache in front of Tomcat, 
> but this requires that Tomcat be set up in a particular way.
> 
> Here is what happens here when a webapp is started:
> 
> * Apache is configured to display a static page for the corresponding 
> server name and path;
> * I use Tomcat's manager webapp to deploy the new context;
> * on success, Apache is reconfigured to forward requests and its 
> configuration reloaded.
> 
> For this, Tomcat is started with only the manager webapp, and only in 
> text mode from localhost. Contexts are then deployed and undeployed on 
> demand. One problem with Tomcat is that the bundled startup scripts 
> will return _before_ Tomcat is fully bootstrapped, which is why I have 
> to use my own. This has been discussed at length a few months ago, and 
> is why I have my current setup. It is the only way for me to have the 
> behavior I seek.
> 
> --
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> fge@one2team.com
> 40 avenue Raymond Poincaré
> 75116 Paris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

--
View this message in context: http://old.nabble.com/Display-a-static-page-while-application-loading.-tp32493013p32494281.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



Re: Display a static page while application loading.

Posted by Eric Bouer <er...@gmail.com>.
Thanks you Francis but I can't use a apache frontend.
I'm looking for a solution in tomcat itself, And I guess it's a common
request since many applications have long startup times and this can be very
annoying to get a blank page in production.



Francis Galiegue-4 wrote:
> 
> On Mon, Sep 19, 2011 at 09:45, Eric Bouer <er...@gmail.com> wrote:
>>
>> Hello list.
>> I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
>> The spring container and hibernate bootstrap are slow and the users get a
>> blank page or no response from tomcat while the application starts.
>> In order to avoid that I was thinking about some static page that can be
>> served by a different thread but the problem is that there are muiltiple
>> wars and I wish to have a simple solution.
>>
>> I'd like to know if Tomcat already provides a solution for this problem
>> or
>> if it is a planned feature request (couldn't find any)
>> Or is there another way to solve this issue?
>> Thanks.
>>
> 
> With Tomcat alone, no idea. I do that with Apache in front of Tomcat,
> but this requires that Tomcat be set up in a particular way.
> 
> Here is what happens here when a webapp is started:
> 
> * Apache is configured to display a static page for the corresponding
> server name and path;
> * I use Tomcat's manager webapp to deploy the new context;
> * on success, Apache is reconfigured to forward requests and its
> configuration reloaded.
> 
> For this, Tomcat is started with only the manager webapp, and only in
> text mode from localhost. Contexts are then deployed and undeployed on
> demand. One problem with Tomcat is that the bundled startup scripts
> will return _before_ Tomcat is fully bootstrapped, which is why I have
> to use my own. This has been discussed at length a few months ago, and
> is why I have my current setup. It is the only way for me to have the
> behavior I seek.
> 
> -- 
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 683 877 875
> Tel : +33 (0) 178 945 552
> fge@one2team.com
> 40 avenue Raymond Poincaré
> 75116 Paris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Display-a-static-page-while-application-loading.-tp32493013p32494281.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Display a static page while application loading.

Posted by Francis GALIEGUE <fg...@one2team.com>.
On Mon, Sep 19, 2011 at 09:45, Eric Bouer <er...@gmail.com> wrote:
>
> Hello list.
> I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
> The spring container and hibernate bootstrap are slow and the users get a
> blank page or no response from tomcat while the application starts.
> In order to avoid that I was thinking about some static page that can be
> served by a different thread but the problem is that there are muiltiple
> wars and I wish to have a simple solution.
>
> I'd like to know if Tomcat already provides a solution for this problem or
> if it is a planned feature request (couldn't find any)
> Or is there another way to solve this issue?
> Thanks.
>

With Tomcat alone, no idea. I do that with Apache in front of Tomcat,
but this requires that Tomcat be set up in a particular way.

Here is what happens here when a webapp is started:

* Apache is configured to display a static page for the corresponding
server name and path;
* I use Tomcat's manager webapp to deploy the new context;
* on success, Apache is reconfigured to forward requests and its
configuration reloaded.

For this, Tomcat is started with only the manager webapp, and only in
text mode from localhost. Contexts are then deployed and undeployed on
demand. One problem with Tomcat is that the bundled startup scripts
will return _before_ Tomcat is fully bootstrapped, which is why I have
to use my own. This has been discussed at length a few months ago, and
is why I have my current setup. It is the only way for me to have the
behavior I seek.

-- 
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 683 877 875
Tel : +33 (0) 178 945 552
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Display a static page while application loading.

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/9/19 Eric Bouer <er...@gmail.com>:
>
> Hello list.
> I'm using tomcat for a J2EE application that uses Spring/Hibernate/JSF.
> The spring container and hibernate bootstrap are slow and the users get a
> blank page or no response from tomcat while the application starts.
> In order to avoid that I was thinking about some static page that can be
> served by a different thread but the problem is that there are muiltiple
> wars and I wish to have a simple solution.
>
> I'd like to know if Tomcat already provides a solution for this problem or
> if it is a planned feature request (couldn't find any)
> Or is there another way to solve this issue?

1. There are many versions of Tomcat. What one you are using / targeting?

2. Does your Spring initialization happens when the web applications
starts up, or when it is accessed for the first time? It depends on
your you configure spring contexts in your webapp.

3. Are you concerned with blank response while Tomcat itself starts
up,  or when you redeploy your application while Tomcat is already
running?

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Display a static page while application loading.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eric,

On 9/19/2011 3:45 AM, Eric Bouer wrote:
> I'm using tomcat for a J2EE application that uses
> Spring/Hibernate/JSF. The spring container and hibernate bootstrap
> are slow and the users get a blank page or no response from tomcat
> while the application starts. In order to avoid that I was thinking
> about some static page that can be served by a different thread but
> the problem is that there are muiltiple wars and I wish to have a
> simple solution.
> 
> I'd like to know if Tomcat already provides a solution for this
> problem or if it is a planned feature request (couldn't find any) 
> Or is there another way to solve this issue?

Tomcat itself has no such feature, but it sounds like it would be easy
to build yourself.

Presumably, you have a webapp that takes some time to start up, given
all the ServletContextListeners that need to fire.

Instead of doing some long-running task in a (series of)
ServletContextListener(s), you could use a single one to launch a new
thread that performs all your setup and then sets some token in the
application scope (something like "configured"). Couple that with a
Valve or Filter that checks the status of that token and displays so,e
static page and you're done.

Now, this static page won't be available instantly... you'll still
have to wait for Tomcat to read your webapp's web.xml, create whatever
environment you've requested (JNDI, etc.) and then launch your
ServletContextListener, but that should happen "very fast" as Tomcat
has very little overhead for actually launching a webapp. It's usually
the webapp that takes a while to get started.

The best thing for you to do for HA would be to have redundant
services so that nobody ever has to see the "we're not quite up yet"
page. Are you finding that you still get error pages back from Tomcat
during deployment under such conditions?

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk53X7sACgkQ9CaO5/Lv0PAfhwCggdJ7BtKxg58DA8Ubdr54bAK5
z/QAoLokZviEjUEaJkso0nGrY9Cds2y/
=Pjhp
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org