tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksandar Lazic <>
Subject Re: Question about delaying startup of connector
Date Sat, 18 Oct 2014 23:37:48 GMT
Hi Neven.

Am 19-10-2014 01:15, schrieb Neven Cvetkovic:
> Hey Aleks!
> On Sat, Oct 18, 2014 at 6:48 PM, Aleksandar Lazic 
> <>
> wrote:
>> Hi all.
>> We have the need that the tomcat 7 connectors (ajp & http) only start
>> listening on the configured port after the application is started.
>> I have take a look at
>> but I haven't seen a "delay until app start done" flag.
>> I have also searched in the archive
>> I'm sure that I don't understand the tomcat internals enough to see 
>> the
>> easy solution.
>> Thanks for pointing me to the right direction.
>> Maybe It must be done in the app startup phase or somewhere else.
> It would help if you clarify your "need" and reasons why you want this. 
> I
> suspect you don't want "traffic" until the app is ready and configured.
> Tell us more about what are your specific requirements and problem you 
> are
> trying to solve.

That's exactly what we want.
The app "crashes" when requests reach the app at startup phase.
Yes I know this should be handled in the app but you know the world is 
not perfect ;-/

> Few ideas to play with:
> 1) Figure out how to start Tomcat with Connectors disabled or not
> configured. After your application has been successfully
> deployed/configured - enable or configure your connectors. Look at JMX
> MBeans for ways to enable(start)/disable(stop). Also look at the 
> connector
> attribute "bindOnInit", so the connector would wait for binding to a 
> port
> until "start" operation is called on the connector MBean, e.g.
> Catalina:type=Connector,port=8080
> Catalina:type=Connector,port=8009

That was what I've missed, thanks.

To be clear.

1.) <Connector ... bindOnInit=false ... />
2.) Tomcat and app start
3.) when the app is ready to handle requests
     the app "just" need to start over jmx/mbean the connectors.

> 2) Are you using Apache or some other webserver fronting your Tomcat
> instance(s)?

Yes we use the classic

with ping settings

> You could disable the application path on Apache, and once the
> app is configured and ready, turn on the flood gates on Apache or 
> whatever
> webserver you use.

This is another way but I prefer the app way.

> Hope that helps.

Yes thanks, for help.

> Cheers!
> Neven

BR Aleks

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

View raw message