tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [tomcat] preventing to use it at startup
Date Thu, 21 Mar 2013 09:57:31 GMT
Stadelmann Josef wrote:
> Hi
> Is there an easy way to manage, to prevent, that my AS Tomcat is serving
> request before it is fully up and running; while fully up means - it has
> deployed 
> all web apps and web app axis2 (a servlet engine) is up and has deployed
> all its
> modules *.mar and web service archives *.aar before any requests for
> this web
> services are accepted.
I believe that the basic answer to this question is no.
The only thing which knows when an application is ready to answer requests is .. that same


It is not very clear to me what the "bindOnInit" Connector attribute means exactly in that

respect :


Controls when the socket used by the connector is bound. By default it is bound when the 
connector is initiated and unbound when the connector is destroyed. If set to false, the 
socket will be bound when the connector is started and unbound when it is stopped.

(It is probably my lack of knowledge of what precisely is meant by "the connector is 
initiated" versus "the connector is started" here)

But even assuming that it delays the moment when the Connector binds to the port (meaning

that until then, the listening port is not open, and no clients can connect to it), the 
Connector is shared between /all/ applications, so I think that it would be difficult for

the Connector "to know" when /all/ applications are really "ready".  Different 
applications may have different ideas of when they are really "ready to serve requests".

If this is really vital for you, I would look at a servlet filter wrapping your 
application, and some means of communication between that filter and your application.
For example, as long as some "ready flag" is not set, the filter would redirect all 
requests to some "sorry" page; once the flag is set, it would let the requests go through.
And the application would set this flag when it considers itself to be "ready".

Over the years on this list, there have been several questions also related to a 
synchronisation between *different* applications, which is also difficult to do, because 
different applications are supposed to be independent of eachother.
So may, writing this as a <Valve> (tomcat-specific) at the Host level would be more

generic and fill some other needs too.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message