Results 1 to 7 of 7
  1. #1
    karine is offline Member
    Join Date
    Oct 2008
    Posts
    8
    Rep Power
    0

    Default runtime.exec stale process

    How can I kill the runtime.exec stale processes? I tried proc.destroy.. didn't work

    Thanks!

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    I've seen this before (windows I assume). After calling destroy call exitValue. It will cause an exception, so catch it, but after that the process is gone (usually).

    Don't know why it's this way sometimes, but it is.

  3. #3
    karine is offline Member
    Join Date
    Oct 2008
    Posts
    8
    Rep Power
    0

    Default runtime.exec stale process

    I tried it. It didn't work.

    Thanks!

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    I've had a couple like that, too.

    What are you using Runtime.exec() for? There might be a better way, and it might be that you shouldn't be using Java for this at all.

  5. #5
    Join Date
    Oct 2008
    Posts
    68
    Rep Power
    0

    Default

    you may need to try again doing kill by some other process which can identify and kill it....

  6. #6
    karine is offline Member
    Join Date
    Oct 2008
    Posts
    8
    Rep Power
    0

    Default

    I have axis 1.4 webservice running in tomcat 6.0.18. I have a Runtime.exec calling a C program. When my Java client is connecting to the web service to get data through the C program many times (50 times) the Runtime.exec hangs and creates stale processes. How can I avoid this?

    thanks!

  7. #7
    karine is offline Member
    Join Date
    Oct 2008
    Posts
    8
    Rep Power
    0

    Default

    I am thinking of doing "ps -ef | grep processId" Unix command to identify and kill it but it will be a workaround. I was hoping to fix it so it won't create these stale processes and hang.

Similar Threads

  1. Tomcat and Runtime.exec
    By karine in forum Introductions
    Replies: 1
    Last Post: 10-03-2008, 08:25 AM
  2. Runtime.exec()
    By hknyo in forum Advanced Java
    Replies: 2
    Last Post: 08-16-2008, 12:40 AM
  3. Problem with Runtime.exec()
    By nhabibi in forum Advanced Java
    Replies: 11
    Last Post: 07-02-2008, 01:35 AM
  4. Runtime.exec(), handling input and output streams
    By crookshank in forum New To Java
    Replies: 0
    Last Post: 06-05-2008, 02:41 PM
  5. How to get variable values at runtime in another process
    By murali_java in forum Advanced Java
    Replies: 0
    Last Post: 11-02-2007, 08:03 AM

Posting Permissions

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