import-bot (20211) [Avatar] Offline
[Originally posted by kwutzke]


How do I run a background task to start Tomcat 4.1 in Ant? I want to start the
server, if it is not running yet. However, the <exec> and <java> tasks I tried
don't seem to be able to do that. I also tried <parallel>, but Ant just seems
to hang on that task.

The target I wrote:

<property name="local.bootstrap.class">
<property name="local.bootstrap.jar.file">

<path id="local.bootstrap.classpath">
<pathelement path="${local.bootstrap.jar.file}"/>

<target name="start-local" description="Attempts to start local Tomcat.">

<!-- server already running? yes:bye (or restart?), no:startup -->

<java classname="${local.bootstrap.class}" fork="true">
<classpath refid="local.bootstrap.classpath"/>
<arg value="start"/>
<sysproperty key="java.endorsed.dirs">
<sysproperty key="catalina.base" value="${env.CATALINA_HOME}"/>
<sysproperty key="catalina.home" value="${env.CATALINA_HOME}"/>
<sysproperty key="" value="${env.CATALINA_HOME}/temp"/>

The Java system properties were drawn from the startup scripts in the Tomcat
bin directory, especially

The task works fine. It starts up the server, however... Ant hangs, because
the task is not run in the background...
Can it be done, so that the task is spawnes in the background? What about the
<spawn> task I've heard about?

import-bot (20211) [Avatar] Offline
Re: Background tasks to start Tomcat 4.1
[Originally posted by steve_l]

There is no <spawn> task yet; though a fair few requests for one. It is
awaiting someone to rise to the challenge of writing one that works on all
supported platforms.

Sometimes you can use the shell to start stuff in the background, (nohup, or START in the shell in <exec> and pass in the
command there. Sometimes that works.