Java Runtime exec can hang

Today I was trying to extract the windows eventlog entries in my win-xp box. I have used Eldump to do this. please see my earlier post about this tool http://blog.grassfield.org/2007/06/24/fetch-your-eventlog-entries-with-eldump/ . I have used runtime.exec() to execute this command and extracted the information from the process streams.

The program was extracting the log entries, but hang in between, and went for endless sleep; i.e, the process never ended. Later with some googling, I was adviced to read error stream first, and then process output stream. Also both the streams need to be read concurrently with two threads. This could solve my issue. Try then!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s