You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Peter Adelmann <pe...@yahoo.com> on 2003/01/22 15:53:18 UTC

Starting and Stopping Tomcat without hanging Ant

Hi,

I think I've already seen threads on this but is there a way to successfully start Tomcat from Ant without hanging the Ant script?  I'm trying to dynamically use HttpUnit to test JSP's and need to bounce Tomcat  so it picks up changes to the JSP's, however when I start Tomcat from the script, the script hangs.  Of course once it hangs, stopping Tomcat is pretty much out of the question. From what I've read, it appears that there's not a way this can be done successfully.  

I've already tryed this: I set JAVA_HOME, and CATALINA_HOME for this task in a batch file.  (The script actually is being run from CruiseControl.)

<propertyname="tomcat.bin.dir" value="<my tomcat home>/bin"/>

<target name="startTomcat" description="starts Tomcat">   

    <exec dir="${tomcat.bin.dir}" executable="cmd" os="Windows 2000">
       <arg value="/c startup.bat"/>
    </exec>

</target>

I'm hanging as well so any input would be appreciated...Peter



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Re: Starting and Stopping Tomcat without hanging Ant

Posted by Peter Adelmann <pe...@yahoo.com>.
Bill,
Thanks a million.  I'm going to run off and try this, so if it works, you're a life saver..Peter
 Bill Burton <bi...@progress.com> wrote:Hello,

I just posted a solution for this. See 
http://marc.theaimsgroup.com/?l=ant-user&m=104322316306620&w=2.

Modifying what you have below to use the antRunAsync scripts would look 
like this:





/bin" name="tomcat.bin.dir">




vmlauncher="false" failonerror="true">

         -->





Hope this helps,
-Bill

Peter Adelmann wrote:
> Hi,
> 
> I think I've already seen threads on this but is there a way to successfully start Tomcat from Ant without hanging the Ant script? I'm trying to dynamically use HttpUnit to test JSP's and need to bounce Tomcat so it picks up changes to the JSP's, however when I start Tomcat from the script, the script hangs. Of course once it hangs, stopping Tomcat is pretty much out of the question. From what I've read, it appears that there's not a way this can be done successfully. 
> 
> I've already tryed this: I set JAVA_HOME, and CATALINA_HOME for this task in a batch file. (The script actually is being run from CruiseControl.)
> 
> 
/bin" />
> 
> 
> 
> 
> 
> 
> 
> 
> 
> I'm hanging as well so any input would be appreciated...Peter


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



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Re: Starting and Stopping Tomcat without hanging Ant

Posted by Bill Burton <bi...@progress.com>.
Hello,

I just posted a solution for this.  See 
http://marc.theaimsgroup.com/?l=ant-user&m=104322316306620&w=2.

Modifying what you have below to use the antRunAsync scripts would look 
like this:

<property name="antRunAsync" value="${ant.home}/bin/antRunAsync" />
<property name="tomcat.bin.dir" value="<my tomcat home>/bin"/>

<target name="startTomcat" description="starts Tomcat">

     <exec dir="${tomcat.bin.dir}" executable="${antRunAsync}"
           vmlauncher="false" failonerror="true">
        <env key="ANTRUN_TITLE" value="Apache Tomcat" />
        <!-- Or, the following to log all output to a file
        <env key="ANTRUN_OUTPUT" value="tomcat.log" /> -->
        <arg value="startup" />
     </exec>

</target>

Hope this helps,
-Bill

Peter Adelmann wrote:
> Hi,
> 
> I think I've already seen threads on this but is there a way to successfully start Tomcat from Ant without hanging the Ant script?  I'm trying to dynamically use HttpUnit to test JSP's and need to bounce Tomcat  so it picks up changes to the JSP's, however when I start Tomcat from the script, the script hangs.  Of course once it hangs, stopping Tomcat is pretty much out of the question. From what I've read, it appears that there's not a way this can be done successfully.  
> 
> I've already tryed this: I set JAVA_HOME, and CATALINA_HOME for this task in a batch file.  (The script actually is being run from CruiseControl.)
> 
> <propertyname="tomcat.bin.dir" value="<my tomcat home>/bin"/>
> 
> <target name="startTomcat" description="starts Tomcat">   
> 
>     <exec dir="${tomcat.bin.dir}" executable="cmd" os="Windows 2000">
>        <arg value="/c startup.bat"/>
>     </exec>
> 
> </target>
> 
> I'm hanging as well so any input would be appreciated...Peter


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>