On Mon, 6 May 2002, Hal Hildebrand <[EMAIL PROTECTED]>
wrote:

> In looking at the code, the problem is that the classes are being
> compared, and since the apparently come from different classloaders,
> the classes don't compare .equals(), thus the error message.

If they come from different class loaders, they may really be
different versions of the same class or simply just have access to
different classes - they are not the same.

The warning may be annoying for you, but in general, it is no false
alarm and something people should be made aware of IMHO.

> The fix we've been using is to use the shutdown hook of the VM to
> destroy the spawned processes on exit.  For example, in Exec.run(),
> 
>             // exec command on system runtime
>             Process proc = Runtime.getRuntime().exec(command);
> 
>             // kill me if Ctrl-C the process
>             ProcessKiller killer = new ProcessKiller(proc);
>             Runtime.getRuntime().addShutdownHook(killer);

<exec> is implemented by ExecTask which delegates the work to
Execute.  This uses a ProcessDestroyer and adds it as a shutdown hook
via reflection (so we can compile on JDK < 1.3).

The code is very similar to yours, so if the shutdown hook gets
triggered by ^Cing Ant - the spawned processes should be killed as
well.

Stefan

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to