You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Roman Sokolyuk <ro...@gmail.com> on 2009/05/29 04:31:22 UTC
Testing if Tomcat is running
Hi,
Ant: 1.7.1
OS: Mac OS X Leopard
Java: 1.5.0_16
Tomcat: 6
I am using the following ant tasks to stop my Tomcat:
<target name="stop-tomcat">
<exec os="Mac OS X" executable="/bin/sh">
<arg line="${tomcat}/bin/shutdown.sh" />
</exec>
<sleep seconds="5" />
</target>
but when it is executed and Tomcat is already down it obviously throws an
exception.
Could anyone suggest how I could test whether Tomcat is running, and execute
this task only when it is?
Thanks.
Re: Testing if Tomcat is running
Posted by alsen <mi...@gmx.net>.
<waitfor maxwait="xyz" maxwaitunit="xyz" timeoutproperty="xyz">
<socket server="yourtomcat" port="yourport"/>
</waitfor>
Analyze timeoutproperty.
Roman Sokolyuk-2 wrote:
>
> Hi,
> Ant: 1.7.1
> OS: Mac OS X Leopard
> Java: 1.5.0_16
> Tomcat: 6
>
> I am using the following ant tasks to stop my Tomcat:
>
> <target name="stop-tomcat">
>
> <exec os="Mac OS X" executable="/bin/sh">
>
> <arg line="${tomcat}/bin/shutdown.sh" />
>
> </exec>
>
> <sleep seconds="5" />
>
> </target>
>
> but when it is executed and Tomcat is already down it obviously throws an
> exception.
>
> Could anyone suggest how I could test whether Tomcat is running, and
> execute
> this task only when it is?
>
> Thanks.
>
>
--
View this message in context: http://www.nabble.com/Testing-if-Tomcat-is-running-tp23773323p23774888.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: Testing if Tomcat is running
Posted by Ja...@rzf.fin-nrw.de.
<condition><url>
Jan
>-----Ursprüngliche Nachricht-----
>Von: Roman Sokolyuk [mailto:romsok.tech@gmail.com]
>Gesendet: Freitag, 29. Mai 2009 04:31
>An: user@ant.apache.org
>Betreff: Testing if Tomcat is running
>
>Hi,
>Ant: 1.7.1
>OS: Mac OS X Leopard
>Java: 1.5.0_16
>Tomcat: 6
>
>I am using the following ant tasks to stop my Tomcat:
>
><target name="stop-tomcat">
>
><exec os="Mac OS X" executable="/bin/sh">
>
><arg line="${tomcat}/bin/shutdown.sh" />
>
></exec>
>
><sleep seconds="5" />
>
></target>
>
>but when it is executed and Tomcat is already down it
>obviously throws an
>exception.
>
>Could anyone suggest how I could test whether Tomcat is
>running, and execute
>this task only when it is?
>
>Thanks.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org