users@glassfish.java.net

Re: asadmin changes in v2.1 effect return status of some commands?

From: Alex Sherwin <alex.sherwin_at_acadiasoft.com>
Date: Tue, 27 Jan 2009 17:04:53 -0500

I was summarizing the commands that were being used, but be assured this
whole process is done correctly with ProcessBuilder, setting the
appropriate env and using threaded consumers for stdout and stderr
streams, and non-blocking writes to the stdin stream.

I am retrieving all of the output of these commands, such as all the
information that is printed by create-domain, yet, the process never
returns after calling .waitFor().

I cannot paste/share my code because it is proprietary, but if necessary
I can create a whole test case.

Although, I'm sure there is a problem with asadmin returning after
create-domain and start-domain. I can watch the output be read, and
I've given the process atleast 30 minutes to see if it ever exits, and
it does not. I have tried constantly monitoring the stdout/stderr
streams for available bytes etc, and nothing appears to be out of the
ordinary, except that the process does not exit...



glassfish_at_javadesktop.org wrote:
> Uh Oh. Doing a Runtime.exec needs careful redirection of streams and the default handling
> (especially on Windows) fills up the buffer for someone to read. But if none reads it, the program
> will hang. Note that both start-domain and create-domain write lots of information to their
> standard output and hence you need to clear the buffer where the output is written.
>
> Please see JDK API for ProcessBuilder to do this right.
>
> -Kedar
> [Message sent by forum member 'km' (km)]
>
> http://forums.java.net/jive/thread.jspa?messageID=328487
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>
>
>