ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Woods" <>
Subject RE: Waiting for server to start
Date Fri, 13 Feb 2004 13:40:22 GMT
How about a combination of the <get> and <loadfile> tasks?

-----Original Message-----
[] On
Behalf Of Keith Hatton
Sent: 13 February 2004 10:37
To: Ant-User (E-mail 2)
Subject: Waiting for server to start

Hi all,

Part of my build file starts an application server, performs test cases
against it, and shuts down the server. I'm successfully using the <parallel>
task to achive this, conceptually like so:

  |           |
start       wait
  |           |
  |        run tests
  |           |
  |         stop
  |           |

My problem is the "wait" part. I have been using <waitfor> and <url> to
check for the app server's URL, but recently I have noticed that sometimes
the URL is available before the server initialisation has really completed,
which can lead to spurious test failures, and (for very small projects) even
the possibility that the "stop" task is called before the server has really

The server is JBoss, and strictly I should be checking the server output for
a text string. Any ideas on the best way to do this?

(Current "start" target):
            <echo>Starting JBoss ...</echo>
            <exec dir="${jboss.home}/bin" executable="cmd.exe" os="Windows
2000" output="jboss.out">
                <arg line="/c run.bat"/>
                <env key="NOPAUSE" value="true"/>
            <echo>JBoss has stopped</echo>

(Current "wait" target ... the <sleep> is a hack to work around the
            <echo>Waiting for JBoss ...</echo>
            <waitfor maxwait="120" maxwaitunit="second" checkevery="20"
                <http url="http://localhost:8080/jmx-console"/>
            <sleep seconds="10"/>
            <echo>JBoss has started</echo>

Thanks for any suggestions

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

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

View raw message