You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nathan Aaron <na...@glenraven.com> on 2009/03/25 16:48:00 UTC
tomcat startup
Is it possible to start Tomcat and not start deployed Contexts. For
example I have several statically deployed contexts. When I start
Tomcat I do not want them to be available. Is this possible?
Thanks,
Nathan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: tomcat startup
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Nathan Aaron [mailto:naaron@glenraven.com]
> Subject: Re: tomcat startup
>
> All the contexts started when Tomcat started.
What version of Tomcat are you using? (You should always state that in the first post of a new thread, along with the JRE/JDK and platform you're on.)
- 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat startup
Posted by Nathan Aaron <na...@glenraven.com>.
I could possibly do this, but I wouldn't want to loop for too long or
the sysadmin will start complaining that his machine is hanging at
boot! The ideal thing would be a option for each context that states
whether it should start or not. For the time being I will just try
restarting the context if wget can connect to tomcat manager when the db
starts.
Thanks,
Nathan
Rusty Wright wrote:
> As a workaround/kludge, could you have your tomcat startup scripts use
> the database command line tool to query the database and if it fails
> or doesn't return something reasonable, have it in a loop that sleeps
> for 5 or so seconds and then tries again?
>
>
> Nathan Aaron wrote:
>> I am using Tomcat 6.0.18 and jdk1.6.0_12. I apologize for not posting
>> that in the beginning.
>>
>> I deploy several applications using one instance of Tomcat. The
>> Application uses a database that resides on a separate server. When
>> these servers are rebooted I would prefer that Tomcat start on server
>> A. Then on server B, the database startup script can just make a call
>> to start the context. If I don't do it this way Tomcat will start and
>> start all the contexts. If the database is not available they will
>> fail to start.
>>
>> Thanks,
>> Nathan
>>
>> Caldarale, Charles R wrote:
>>>> From: Nathan Aaron [mailto:naaron@glenraven.com]
>>>> Subject: Re: tomcat startup
>>>>
>>>> <Host name="localhost" appBase="webapps"
>>>> unpackWARs="true" autoDeploy="true" deployXML="true"
>>>> xmlValidation="false" xmlNamespaceAware="false"
>>>> deployOnStartup="false">
>>>>
>>>> This had no effect. All the contexts started when Tomcat started.
>>>>
>>>
>>> I don't think they did - at least they didn't in my testing with
>>> 6.0.18. However, ten seconds *after* Tomcat started, the autoDeploy
>>> monitor kicked in, and that did deploy all the webapps. I tried
>>> setting autoDeploy to false as well, restarted Tomcat, and then
>>> nothing deployed - ever. Nor could I figure out a way to deploy
>>> anything manually, since the manager webapp wasn't deployed (catch-22).
>>>
>>> One way around this is to keep your webapps in some directory other
>>> than the one pointed to by the <Host> appBase and deploy them by
>>> placing a <Context> element with the appropriate docBase setting in
>>> conf/Catalina/[host]/[appName].xml when you want the associated
>>> webapp to start. Your Tomcat shutdown script would then remove all
>>> such files to prevent their automatic redeployment on the next
>>> Tomcat startup.
>>>
>>> But let's back up one step from the original question: why do you
>>> not want the webapps to deploy when Tomcat starts?
>>>
>>> - 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-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
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat startup
Posted by Rusty Wright <ru...@gmail.com>.
As a workaround/kludge, could you have your tomcat startup scripts use the database command line tool to query the database and if it fails or doesn't return something reasonable, have it in a loop that sleeps for 5 or so seconds and then tries again?
Nathan Aaron wrote:
> I am using Tomcat 6.0.18 and jdk1.6.0_12. I apologize for not posting
> that in the beginning.
>
> I deploy several applications using one instance of Tomcat. The
> Application uses a database that resides on a separate server. When
> these servers are rebooted I would prefer that Tomcat start on server A.
> Then on server B, the database startup script can just make a call to
> start the context. If I don't do it this way Tomcat will start and start
> all the contexts. If the database is not available they will fail to start.
>
> Thanks,
> Nathan
>
> Caldarale, Charles R wrote:
>>> From: Nathan Aaron [mailto:naaron@glenraven.com]
>>> Subject: Re: tomcat startup
>>>
>>> <Host name="localhost" appBase="webapps"
>>> unpackWARs="true" autoDeploy="true" deployXML="true"
>>> xmlValidation="false" xmlNamespaceAware="false"
>>> deployOnStartup="false">
>>>
>>> This had no effect. All the contexts started when Tomcat started.
>>>
>>
>> I don't think they did - at least they didn't in my testing with
>> 6.0.18. However, ten seconds *after* Tomcat started, the autoDeploy
>> monitor kicked in, and that did deploy all the webapps. I tried
>> setting autoDeploy to false as well, restarted Tomcat, and then
>> nothing deployed - ever. Nor could I figure out a way to deploy
>> anything manually, since the manager webapp wasn't deployed (catch-22).
>>
>> One way around this is to keep your webapps in some directory other
>> than the one pointed to by the <Host> appBase and deploy them by
>> placing a <Context> element with the appropriate docBase setting in
>> conf/Catalina/[host]/[appName].xml when you want the associated webapp
>> to start. Your Tomcat shutdown script would then remove all such
>> files to prevent their automatic redeployment on the next Tomcat startup.
>>
>> But let's back up one step from the original question: why do you not
>> want the webapps to deploy when Tomcat starts?
>>
>> - 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-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
Re: tomcat startup
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Nathan,
On 3/26/2009 7:52 AM, Nathan Aaron wrote:
> I deploy several applications using one instance of Tomcat. The
> Application uses a database that resides on a separate server. When
> these servers are rebooted I would prefer that Tomcat start on server A.
> Then on server B, the database startup script can just make a call to
> start the context. If I don't do it this way Tomcat will start and start
> all the contexts. If the database is not available they will fail to start.
You could use lazy resource loading instead of forcing everything to
work properly at application start.
Note that Tomcat should be running in the background by the time this
code would run, so looping forever waiting for the db to come up
shouldn't make it look like the system is stalled during boot. It may
look like the /application/ has stalled (which it has), but you were
expecting that anyway if you were trying to keep the app from starting
until the database was ready.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAknM+cEACgkQ9CaO5/Lv0PA0QgCguaP8ygjqUA0lw+dMvrCYP6lQ
uxwAniwZXNgjXLskOBmGsHfMCtboqcE9
=rM0Q
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat startup
Posted by Nathan Aaron <na...@glenraven.com>.
I am using Tomcat 6.0.18 and jdk1.6.0_12. I apologize for not posting
that in the beginning.
I deploy several applications using one instance of Tomcat. The
Application uses a database that resides on a separate server. When
these servers are rebooted I would prefer that Tomcat start on server A.
Then on server B, the database startup script can just make a call to
start the context. If I don't do it this way Tomcat will start and start
all the contexts. If the database is not available they will fail to start.
Thanks,
Nathan
Caldarale, Charles R wrote:
>> From: Nathan Aaron [mailto:naaron@glenraven.com]
>> Subject: Re: tomcat startup
>>
>> <Host name="localhost" appBase="webapps"
>> unpackWARs="true" autoDeploy="true" deployXML="true"
>> xmlValidation="false" xmlNamespaceAware="false"
>> deployOnStartup="false">
>>
>> This had no effect. All the contexts started when Tomcat started.
>>
>
> I don't think they did - at least they didn't in my testing with 6.0.18. However, ten seconds *after* Tomcat started, the autoDeploy monitor kicked in, and that did deploy all the webapps. I tried setting autoDeploy to false as well, restarted Tomcat, and then nothing deployed - ever. Nor could I figure out a way to deploy anything manually, since the manager webapp wasn't deployed (catch-22).
>
> One way around this is to keep your webapps in some directory other than the one pointed to by the <Host> appBase and deploy them by placing a <Context> element with the appropriate docBase setting in conf/Catalina/[host]/[appName].xml when you want the associated webapp to start. Your Tomcat shutdown script would then remove all such files to prevent their automatic redeployment on the next Tomcat startup.
>
> But let's back up one step from the original question: why do you not want the webapps to deploy when Tomcat starts?
>
> - 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
RE: tomcat startup
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Nathan Aaron [mailto:naaron@glenraven.com]
> Subject: Re: tomcat startup
>
> <Host name="localhost" appBase="webapps"
> unpackWARs="true" autoDeploy="true" deployXML="true"
> xmlValidation="false" xmlNamespaceAware="false"
> deployOnStartup="false">
>
> This had no effect. All the contexts started when Tomcat started.
I don't think they did - at least they didn't in my testing with 6.0.18. However, ten seconds *after* Tomcat started, the autoDeploy monitor kicked in, and that did deploy all the webapps. I tried setting autoDeploy to false as well, restarted Tomcat, and then nothing deployed - ever. Nor could I figure out a way to deploy anything manually, since the manager webapp wasn't deployed (catch-22).
One way around this is to keep your webapps in some directory other than the one pointed to by the <Host> appBase and deploy them by placing a <Context> element with the appropriate docBase setting in conf/Catalina/[host]/[appName].xml when you want the associated webapp to start. Your Tomcat shutdown script would then remove all such files to prevent their automatic redeployment on the next Tomcat startup.
But let's back up one step from the original question: why do you not want the webapps to deploy when Tomcat starts?
- 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: tomcat startup
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Subject: RE: tomcat startup
>
> did you try to update catalina.properties as rainier suggested?
Rainer's comment was in a completely different thread for a completely different problem.
> in any event please post your catalina.properties
Totally irrelevant for this issue.
- 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: tomcat startup
Posted by Martin Gainty <mg...@hotmail.com>.
Hello Aaron
did you try to update catalina.properties as rainier suggested?
in any event please post your catalina.properties
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung / Disclaimer and confidentiality note
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
This message is confidential and may be privileged. If you are not the intended recipient, we kindly ask you to please inform the sender. Any unauthorised dissemination or copying hereof is prohibited. This message serves for information purposes only and shall not have any legally binding effect. Given that e-mails can easily be subject to manipulation, we can not accept any liability for the content provided.
> Date: Wed, 25 Mar 2009 15:43:48 -0400
> From: naaron@glenraven.com
> To: users@tomcat.apache.org
> Subject: Re: tomcat startup
>
> Thanks,
>
> I changed the following in the server.xml:
>
> <Host name="localhost" appBase="webapps"
> unpackWARs="true" autoDeploy="true" deployXML="true"
> xmlValidation="false" xmlNamespaceAware="false">
>
> to
>
> <Host name="localhost" appBase="webapps"
> unpackWARs="true" autoDeploy="true" deployXML="true"
> xmlValidation="false" xmlNamespaceAware="false" deployOnStartup="false">
>
> This had no effect. All the contexts started when Tomcat started.
>
> Any other ideas?
>
> Nathan
>
> Caldarale, Charles R wrote:
> >> From: Nathan Aaron [mailto:naaron@glenraven.com]
> >> Subject: tomcat startup
> >>
> >> Is it possible to start Tomcat and not start deployed Contexts.
> >>
> >
> > Set deployOnStartup in the <Host> element to false:
> > http://tomcat.apache.org/tomcat-6.0-doc/config/host.html
> >
> > - 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-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> >
> >
_________________________________________________________________
Windows Liveā¢ SkyDrive: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_skydrive_032009
Re: tomcat startup
Posted by Nathan Aaron <na...@glenraven.com>.
Thanks,
I changed the following in the server.xml:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true" deployXML="true"
xmlValidation="false" xmlNamespaceAware="false">
to
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true" deployXML="true"
xmlValidation="false" xmlNamespaceAware="false" deployOnStartup="false">
This had no effect. All the contexts started when Tomcat started.
Any other ideas?
Nathan
Caldarale, Charles R wrote:
>> From: Nathan Aaron [mailto:naaron@glenraven.com]
>> Subject: tomcat startup
>>
>> Is it possible to start Tomcat and not start deployed Contexts.
>>
>
> Set deployOnStartup in the <Host> element to false:
> http://tomcat.apache.org/tomcat-6.0-doc/config/host.html
>
> - 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
RE: tomcat startup
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Nathan Aaron [mailto:naaron@glenraven.com]
> Subject: tomcat startup
>
> Is it possible to start Tomcat and not start deployed Contexts.
Set deployOnStartup in the <Host> element to false:
http://tomcat.apache.org/tomcat-6.0-doc/config/host.html
- 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org