Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-05-2008, 11:40 AM
Member
 
Join Date: Mar 2008
Posts: 3
gadasie is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-05-2008, 02:28 PM
Member
 
Join Date: Mar 2008
Posts: 3
gadasie is on a distinguished road
The bug was found.. and (surprisingly?!) in my code...
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 03-08-2008, 07:07 PM
CaptainMorgan's Avatar
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
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
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 03-13-2008, 10:04 AM
Member
 
Join Date: Mar 2008
Posts: 3
gadasie is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
while(true) ravian New To Java 5 12-04-2007 10:43 AM
setVisible(true) does not work Gajesh Tripathi AWT / Swing 2 10-27-2007 08:32 PM


All times are GMT +3. The time now is 10:29 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org