Results 1 to 4 of 4
  1. #1
    gadasie is offline Member
    Join Date
    Mar 2008
    Posts
    3
    Rep Power
    0

    Default bug (?) in ProcessBuilder.redirectErrorStream(true);

    Hi All,

    I was trying to run a process using the ProcessBuilder and ran into a problem:
    when running the command with ProcessBuilder and redirecting the errors to output stream (with redirectErrorStream(true) method) we expect all the error messages to be in the ex.getMessage(), as the implementation in runProcess collects all the error messages and throws exception with all these errors in its message.

    Specifically doesn't work: the command I'm trying to run is starting a service on my machine (Windows XP).
    When the service is already started, and I'm running the command again: The result is a failure, but the error message is 'null' (printed in the message).

    BUT if running it with Runtime.exec() and doing the same operation as ProcessBuilder does to collect the errors- the error appears as should be.

    Is there anyone familiar with this???

    thanks in advance,
    Einav.

  2. #2
    gadasie is offline Member
    Join Date
    Mar 2008
    Posts
    3
    Rep Power
    0

    Default

    The bug was found.. and (surprisingly?!) in my code...

  3. #3
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    8

    Default

    gadasie, first welcome to the Java Forums. :)

    Would it possible to post a snippet of code explaining what the bug was and how you derived your solution(which I'm happy you found by the way)? I would be beneficial to the community and might be beneficial to you as well.

    Cheers
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  4. #4
    gadasie is offline Member
    Join Date
    Mar 2008
    Posts
    3
    Rep Power
    0

    Red face dig dig dig!

    Hi CaptainMorgan,

    I believe there is nothing to show since I was an idiot...
    The one and only thing I can suggest (and no code needed) is that when you think you found the problem (e.g. a bug in Sun's code)- DIG DEEPER!!!

    The problem was an exception thrown from unexpected place in the code...

    Till my next stupid question,
    cheers ;)

Similar Threads

  1. while(true)
    By ravian in forum New To Java
    Replies: 7
    Last Post: 06-29-2011, 06:05 AM
  2. setVisible(true) does not work
    By Gajesh Tripathi in forum AWT / Swing
    Replies: 2
    Last Post: 10-27-2007, 07:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •