This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 49489 - build.xml process doesn't end
Summary: build.xml process doesn't end
Status: CLOSED WONTFIX
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Martin Ryzl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-23 15:52 UTC by Lukas Hasik
Modified: 2006-10-23 16:41 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (10.83 KB, text/plain)
2004-09-23 15:55 UTC, Lukas Hasik
Details
part of output and exception (6.60 KB, text/plain)
2004-09-23 15:57 UTC, Lukas Hasik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Hasik 2004-09-23 15:52:04 UTC
nb 200409220845 + me040923, jdk1.5.0-b63, Motorola
iDEN SDK for J2ME(TM) Technology

I have a j2me project. 
When I run it on motorola's emulator the process
build.xml(run) runs forever in IDE even if I
finish the emulator. 
There is a message from emulator that it cannot
write somewhere - probably their bug but the IDE
should finish the process.

I'll attach threaddump, part of output and
exception that I received when I wanted wanted
terminate the process manually.
Comment 1 Lukas Hasik 2004-09-23 15:55:42 UTC
Created attachment 17840 [details]
thread dump
Comment 2 Lukas Hasik 2004-09-23 15:57:51 UTC
Created attachment 17841 [details]
part of output and exception
Comment 3 Jesse Glick 2004-09-23 18:04:10 UTC
Well it's your task, so I'm afraid you'll have to debug it, unless you
can supply a stripped-down test case not involving special J2ME things
that also repeatably fails. (On Win only? or on all platforms?) Might
e.g. be a problem in Ant, or a problem in Java. The IDE certainly is
not directly involved in spawning the external process, so it is
unlikely (though possible) that the bug is in the IDE.

Try the script from the command line first.

Re. the ThreadDeath exception that can be printed when stopping the
process - known that this can happen, but not necessarily
straightforward to deal with. A full UI for shutting down Ant
processes more cleanly is planned for a subsequent release; may
involve API changes in the execution engine and/or output window.
Comment 4 Adam Sotona 2004-09-24 08:46:23 UTC
This bug is well-known in Ant (was AntStreamPumper now it is in
PumpStreamHandler).
See http://issues.apache.org/bugzilla/show_bug.cgi?id=5003

I think it cannot be fixed on our side (except we create patched Ant).
Comment 5 Adam Sotona 2004-09-24 08:47:40 UTC
one more comment

try on Windows in J2SE project create class with:
    public static void main(String args[]) throws Exception {
        Runtime.getRuntime().exec("notepad");
        System.out.println("finished");
    }

and execute it - you will see the bug
Comment 6 Lukas Hasik 2004-09-24 12:58:18 UTC
to Adam's example : the build process is finished when I close the
notepad. And that's behaviour that i'd exactly expect.

But the ant process isn't finished even if the run app (emulator) is
finished and that's the difference.
Comment 7 Adam Sotona 2004-09-24 13:10:51 UTC
The behavior of the example is not correct (compare it to something
similar on Linux or other systems).
Ant process must finish when your process has finished and not after
all stream are closed. I think that on Unix systems standard stream
cannot survive its owning process.
The example shows how the out and err streams are pushed to all
invoked processes from yours and that Ant does not end until all of
them are closed.
Motorola emulator might cause some stream to stay opened and this is
the result.

Solution for Ant is to implement interruptable stream pumpers, try to
join them with some timeout when the process has finished and
interrupt them after the timout expired. Everything about this issue
is described in Ant Bugzilla.
Comment 8 Lukas Hasik 2006-01-17 13:57:26 UTC
verifying all old issues