70010

java.lang.Process.waitFor() is hanging

Question:

I am trying to execute below command on Solaris which is hanging.

<blockquote>

swmml -l /tmp/swmmlLog.txt -n N1 -e DISPLAY-M3UA-LSET;

;swmml -> perl script.

</blockquote>

I tried to flush out the streams/closing the streams. Nothing is working. I tried with both ProcessBBuilder and Runtime.exec() but of no success.

We tried to read from the streams.But the read method is itself hanging. The following code is not printing anything.

while (true) { String s = br.readLine (); if (s == null) break; System.out.println (s); }

Answer1:

You say that you are flushing and closing the streams, but are you fully <em>reading</em> the content of both standard out and standard error?

A common problem is that the child process blocks because its standard error pipe fills up when the parent Java process neglects to consume its output.

Recommend

  • Extract data between rows r
  • Dependable views in Ember
  • How to handle empty space in url when downloading image from web?
  • A class implementing two different IObservables?
  • Avoid registering duplicate broadcast receivers in Android
  • Java making confirming exit
  • How to Save JSON data to SQL server database in C#?
  • perl, mysql - fasting way to upload a csv file into mysql?
  • Get specific string
  • Is there a perl module to validate passwords stored in “{crypt}hashedpassword” “{ssha}hashedpassword
  • Is there a way to do normal logging with EureakLog?
  • PHP buffered output depending on server setting?
  • DomPDF {PAGE_NUM} not on first page
  • Disabling Alt-F4 on a Win Forms NotifyIcon
  • Javascript simulate pressing enter in input box
  • Importing jscolor library in angular 2
  • How do you troubleshoot character encoding problems?
  • Matplotlib draw Spline from multiple points
  • WOWZA + RTMP + HTML5 Playback?
  • XCode can't find symbols for a specific iOS library/framework project
  • Calling of Constructors in a Java
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Compare two NSDates in iPhone
  • Transpose CSV data with awk (pivot transformation)
  • Use group_by to filter specific cases while keeping NAs
  • Matrix multiplication with MKL
  • A cron job substitute?
  • log4net write single file for each call to log.info
  • Benchmarking RAM performance - UWP and C#
  • Acquiring multiple attributes from .xml file in c#
  • Hits per day in Google Big Query
  • Angular 2 constructor injection vs direct access
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • File not found error Google Drive API
  • LevelDB C iterator
  • How can I remove ASP.NET Designer.cs files?
  • Can't mass-assign protected attributes when import data from csv file
  • Programmatically clearing map cache
  • Converting MP3 duration time
  • java string with new operator and a literal