OK. I tried to work you suggestions into my buildfile.
My idea is to keep tomcat up and running and simply restart
the catalina process:

<exec executable="cmd.exe" dir="C:/Programme/Apache Software
Foundation/Tomcat 5.0/bin" os="Windows XP" failonerror="true">
   <arg line="/c catalina.bat"/>
 <arg value="restart"/>
</exec>

This saves some time. Then I just  put in the sync-block you suggested:

<waitfor maxwait="10" maxwaitunit="second">
   <http url="http://localhost:5050/ae/"/>
</waitfor>

And afterwards I start a browser to display the results :

<exec executable="C:\Programme\Mozilla Firefox\firefox.exe" os="Windows XP" description="Launch web page in Firefox">
<arg value="-url"/>
<arg value="localhost:5050/ae/"/>
</exec>


The only problem with this approach is that Tomcat is still holding on to the application files
when I try to remove them and replace them with the newer version.


<delete dir="${dir.tomcat}/ae" />
  <delete>

Does anybody have an  idea how to work around this problem ?

Regards,

Peter

Hello Peter and Igor,

Here is a code the makes a slightly different  task -
it checks whether a war file has been deployed
correctly using <waitfor> task [1] and <http> [2]
condition:

<property name="install.context" value="mywebapp"/>
<property name="install.port" value="8080"/>
<property name="install.httpurl"
value="http://localhost:${install.port}/${install.context}/index.jsp"/>

<target name="deploy" depends="initdb"
description="Deploys arcade's war">
   <copy
file="${basedir}/${branch}${project.name}.war"
tofile="${catalina.home}/webapps/${project.name}.war"/>
   <waitfor timeoutproperty="time.out.property">
       <http url="${install.httpurl}"/>
   </waitfor>
   <fail if="time.out.property" message="Deployment
failed. Check whether Tomcat Service is started and if
not start it."/>
   <echo message="Deployment finished. Arcade
application is ready to be accessed"/>
</target>

Besides <http> condition you can use also <socket>
that probes for a listening application on a given
port.

HTH Ivan

[1]http://ant.apache.org/manual/CoreTasks/waitfor.html
[2]http://ant.apache.org/manual/CoreTasks/conditions.html

--- "Igor A. Deruga" <[EMAIL PROTECTED]> wrote:



Hello, Peter!

As far as I remember, I used to stop Tomcat before
building project and start it after the build. If it isn't currently running,
the stop task would fail, but nothing bad would happen. So you just try to
stop it and then - start it.


I don't think that it's a good idea to look at "ps
-A" output ;)

Sincerely
        Igor

On Monday 15 November 2004 21:38, Peter Neu wrote:


Thanks. This solved the problem.

One last thing: How can I test if Tomcat is still


runnig in order to invoke


first the shutdown.bat before I proceed ?




---------------------------------------------------------------------


To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]








__________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to