You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pradeep Fernando <pr...@gmail.com> on 2012/02/06 17:21:56 UTC

starting connectors after the tomcat startup

Hi all,

I'm using embedded tomcat within my application. I configured the
org.apache.catalina.startup.Tomcat class using the server.xml found in
tomcat distribution.
But i want to start my connectors after some requirement are met (The
necessary resources being initialized).

My approach was to set the connector param,

bindOnInit = "false"

and then start the connectors at a later stage using connector.start();


but it looks like my connectors are in the "STARTED" life-cycle stage
once i do the Tomcat.start() call. - means they are already started
Am i missing something. How can i achieve my requirement.?

thanks
--Pradeep

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


Re: starting connectors after the tomcat startup

Posted by Pradeep Fernando <pr...@gmail.com>.
Hi all,

I could achieve the required behaviour by extending the
standardService provided by tomcat. In my overrided startInternal()
method i just dont start connectors.


thanks,
--Pradeep

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


Re: starting connectors after the tomcat startup

Posted by Pradeep Fernando <pr...@gmail.com>.
Hi,

Let me explain my scenario. I'm running tomcat inside an OSGi
environment. There I create http.service out of tomcat. I do that in a
servlet init method and set the loadOnStartup to '1' for that
servlet.

Now during the server startup my http.service get exposed and other
bundles make use of that service. Since the starting order of my
bundles depends on the OSGi service dependencies, my application is
ready to process request only when all the bundles are ready. At that
point i want start the connectors.

The problems is, When I call Tomcat.start() it starts connectors as
well. If I call Tomcat.init(), it does not initiate my servlet which,
in-turn registers the http.service.


thanks,
--Pradeep

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


Re: starting connectors after the tomcat startup

Posted by Domenico Briganti <do...@gmail.com>.
Hi Fernando, 
	open HTTP/AJP il the last step that tomcat do when it starts. Why don't
you put your initializzations on webapp's context initialize and wait
the ready of your resource that?

Regards
Domenico


Il giorno lun, 06/02/2012 alle 21.51 +0530, Pradeep Fernando ha scritto:
> Hi all,
> 
> I'm using embedded tomcat within my application. I configured the
> org.apache.catalina.startup.Tomcat class using the server.xml found in
> tomcat distribution.
> But i want to start my connectors after some requirement are met (The
> necessary resources being initialized).
> 
> My approach was to set the connector param,
> 
> bindOnInit = "false"
> 
> and then start the connectors at a later stage using connector.start();
> 
> 
> but it looks like my connectors are in the "STARTED" life-cycle stage
> once i do the Tomcat.start() call. - means they are already started
> Am i missing something. How can i achieve my requirement.?
> 
> thanks
> --Pradeep
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 




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