ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hal Hildebrand \(web\)" <Hal.Hildebr...@hellblazer.com>
Subject Re: Cannot run Windows shell commands like start from ant : Please help me.
Date Fri, 24 May 2002 06:00:32 GMT
If your doing testing (as opposed to launching for actual use), you
should try using the <parallel> task.  Something like:

<parallel>
    <sequential>
        ...  start your process
    </sequential>

    <sequential>
        <condition>
            ...  wait for the http server to come up - can't remember
the 1.5 syntax
        </condition>
        <junit>
            .. test
        </junit>
        ...  stop the process (via some utility, like "stop" for Tomcat)
    </sequential>
</parallel>

The advantage of doing it this way, rather than spawning a peer process,
is that when you ^C the Ant process, all the processes will be killed.
If you spawn, you're going to have to clean up these processes manually,
which can be a royal pain in the butt.

----- Original Message -----
From: "Steven Jeffriess" <Steven.Jeffriess@motorola.com>

> think you'll find that start is not an executable.
> haven't tried it under ant but you should be able to achieve the same
with
> "cmd.exe" and the the args "/C" & "start"
>
> hth
> steve
>
> Viraj Purang wrote:
>
> > Hi,
> >    I tried to run just "start" command using the "exec" task.
> > It does not work, however , all other batch scripts run just fine
for me.
> >
> > I am doing this in order to run the weblogic server , and get the
control
> > back even as the server runs off the start window, so that I can run
the
> > junit test library ...
> >
> > -------------------------------------
> > ant -debug log shows ...
> > ---------------------------------
> > run_windows:
> > Property ${env.PATH} has not been set
> >      [exec] Current OS is Windows 2000
> >      [exec] start C:\depot\cajun\knex\build\bin\runWebLogic.cmd
> >      [exec] Output redirected to C:\weblogic.log
> >      [exec] Setting environment variable:
> > WL_HOME=C:\depot\cajun\bea\weblogic70
> > \server
> >      [exec] Setting environment variable: PATH=${env.PATH}
> > Execute:Java13CommandLauncher: start
> > C:\depot\cajun\knex\build\bin\runWebLogic.
> > md
> >
> > BUILD FAILED
> >
> > C:\build.xml:338: Execute failed: java.io.IOException:
CreateProcess: start
> > C:\
> > epot\cajun\knex\build\bin\runWebLogic.cmd error=2
> >         at
org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:281)
> >         at
org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177)
> >         at org.apache.tools.ant.Task.perform(Task.java:217)
> >         at org.apache.tools.ant.Target.execute(Target.java:184)
> >         at org.apache.tools.ant.Target.performTasks(Target.java:202)
> >         at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
> >         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:266)
> >         at
> > org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120
> >
> >         at org.apache.tools.ant.Task.perform(Task.java:217)
> >         at org.apache.tools.ant.Target.execute(Target.java:184)
> >         at org.apache.tools.ant.Target.performTasks(Target.java:202)
> >         at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
> >         at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
> >         at org.apache.tools.ant.Main.runBuild(Main.java:454)
> >         at org.apache.tools.ant.Main.start(Main.java:153)
> >         at org.apache.tools.ant.Main.main(Main.java:176)
> > --- Nested Exception ---
> > java.io.IOException: CreateProcess: start
> > C:\depot\cajun\knex\build\bin\runWebL
> > gic.cmd error=2
> >         at java.lang.Win32Process.create(Native Method)
> >         at java.lang.Win32Process.<init>(Win32Process.java:61)
> >         at java.lang.Runtime.execInternal(Native Method)
> >         at java.lang.Runtime.exec(Runtime.java:546)
> >         at java.lang.reflect.Method.invoke(Native Method)
> >         at
> > org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Exe
> > ute.java:564)
> >         at
org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:384)
> >         at
> > org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:250)
> >         at
org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:279)
> >         at
org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:177)
> >         at org.apache.tools.ant.Task.perform(Task.java:217)
> >         at org.apache.tools.ant.Target.execute(Target.java:184)
> >         at org.apache.tools.ant.Target.performTasks(Target.java:202)
> >         at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
> >         at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:266)
> >         at
> > org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:120
> >
> >         at org.apache.tools.ant.Task.perform(Task.java:217)
> >         at org.apache.tools.ant.Target.execute(Target.java:184)
> >         at org.apache.tools.ant.Target.performTasks(Target.java:202)
> >         at
org.apache.tools.ant.Project.executeTarget(Project.java:601)
> >         at
org.apache.tools.ant.Project.executeTargets(Project.java:560)
> >         at org.apache.tools.ant.Main.runBuild(Main.java:454)
> >         at org.apache.tools.ant.Main.start(Main.java:153)
> >         at org.apache.tools.ant.Main.main(Main.java:176)
> >
> > Total time: 1 second
> >
> > Regards,
> > Viraj Purang
> >
> > --
> > To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:ant-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message