You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Donald Strong <ds...@agentissoftware.com> on 2005/01/04 23:41:16 UTC

Launching Tomcat from Ant.

Hi all,

I am having a problem launching tomcat from ant.
It works fine when I run ant in a dos shell
but not when I run ant from a cygwin shell.

        <exec os="Windows 95, Windows 98, Windows Me, Windows NT, Windows
XP, Windows CE"
              executable="${tomcat.dir}/bin/catalina.bat" spawn="true"
              dir="${tomcat.dir}">
            <arg line='jpda start'/>
        </exec>
        <echo message="Waiting for Tomcat to start..."/>
        <waitfor maxwait="30" maxwaitunit="second"
                 timeoutproperty="tomcat.failed">
            <http url="${tomcat.manager.url}"/>
        </waitfor>
        <fail if="tomcat.failed"/>

Any suggestions welcome.

Donald.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Launching Tomcat from Ant.

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 4, 2005, at 5:41 PM, Donald Strong wrote:

> Hi all,
>
> I am having a problem launching tomcat from ant.
> It works fine when I run ant in a dos shell
> but not when I run ant from a cygwin shell.
>
>         <exec os="Windows 95, Windows 98, Windows Me, Windows NT, 
> Windows
> XP, Windows CE"
>               executable="${tomcat.dir}/bin/catalina.bat" spawn="true"
>               dir="${tomcat.dir}">
>             <arg line='jpda start'/>
>         </exec>
>         <echo message="Waiting for Tomcat to start..."/>
>         <waitfor maxwait="30" maxwaitunit="second"
>                  timeoutproperty="tomcat.failed">
>             <http url="${tomcat.manager.url}"/>
>         </waitfor>
>         <fail if="tomcat.failed"/>
>
> Any suggestions welcome.

I suggest switching to Jetty :) -

         <java classname="org.mortbay.jetty.Server" fork="true" 
maxmemory="128M">
             <classpath>
                 <fileset dir="${jetty.dir}">
                     <include name="lib/*.jar"/>
                     <include name="ext/*.jar"/>
                 </fileset>
                 <path refid="web.classpath"/>
             </classpath>

             <arg value="config/jetty.xml"/>
         </java>

You'd then be able to reduce your <waitfor> to far far less than the 30 
seconds you currently have!

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org