ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bin Yan \(Tony\)" <>
Subject process problem from Ant extension
Date Sat, 28 Sep 2002 18:09:01 GMT
Hi, All:

This is my first post in this list. I have been using
Ant for about a month. Here is the problem I have
encountered that I can't figure out. 

We build our project on UNIX. The Ant script
originally was to copy from the source to temp dir
before compiling. Now since we use SCCS for source
control, I have extended the Ant core task Copy to
CopySccs and overridden the buildMap() to do something
like the following. When the overridden buildMap() is
run, it will call another Class MyExecute which
extends Execute. And it basically will prepare some
command and parameter (with filename and path) and
calls an external UNIX command which does some logging
and status checking. Eventually, the action goes into
the execute() method of Execute. This method is not

For each of the file I copy, Ant goes to call
execute() which I found basically gets a Process from
OS and run the external command. A watchdog
(ExecuteWatchDog) is used to monitor the process, if
is more than the time of watchdog's limit, it will
kill the process. But in my case, SOMETIMES the Ant
process will hang in execute() method. It happens only
1/3 of the time. 2/3 of the time, the ant build goes
without a problem. 

I checked that the execute() method calls
java.lang.Process.waitFor() method, which by API

" causes the current thread to wait, if necessary,
until the process represented by this Process object
has terminated.".

So I am not sure if this is actually a problem coming
from UNIX that the process can't be terminated instead
of Ant itself. The hanging never happends inside UNIX
command itself, with no java exception been thrown
either. I think either the Process never get generated
or somehow the Process can't start running ... really
now sure.

I can provide more info. at any time.


Tony Yan

 -- I love NY, now more than ever.

Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

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

View raw message