Re: Persistence of process thread despite re-loading browser

Sam Seaver <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Eric,

I'm using RedHat 7.2, Linux 2.4.7-10, JSDK1.4.1, Perl 5.8.0

I've kind of given up. Since the whole software is being run after
communication from the applet (which just resends the link of the page it
resides in with additional parameters) ive decided to try and run the
program using a native SOAP::Lite module connected to my Apache2 (the tomcat
is not stand-alone) and the use SOAP from within the applet to communicate
more directly.

But I am still very interested in what went wrong, in addition, im really
bad at error-trapping, and I was wondering what you did to check the exit
values, if you have any code you did in your sampling?

Cheers
Sam
>
>    I have done some preliminary testing on Linux 2.4.18-27.7.x, and I
>have found based on the exit codes returned, that the Runtime.exec()
>interface seems to be badly broken.  I'm not too sure that the problem
>is a cache at this point.  What are you running on?
>
>Sam Seaver wrote:
>
>>Dear all,
>>
>>I have this code in a bean:
>>
>>
>>public void doMonster(){
>>        String[] cmd ={"/home/seaver/MONSTER/monster", "-i" + jobID,
>>filePath + dir
>>+ pdbFileName};
>>
>>
>>        try{
>>            Process proc = Runtime.getRuntime().exec(cmd);
>>            BufferedWriter output = new BufferedWriter(new
>>OutputStreamWriter(proc.getOutputStream()));
>>            BufferedReader input = new BufferedReader(new
>>InputStreamReader(proc.getInputStream()));
>>            BufferedReader error = new BufferedReader(new
>>InputStreamReader(proc.getErrorStream()));
>>
>>
>>            output.close();
>>            input.close();
>>            error.close();
>>        }catch (Throwable t){
>>            t.printStackTrace();
>>        }
>>    }
>>
>>I have a JSP page that simply runs doMonster, the bean's parameters are
>>already in the bean, and the first time, monster runs very well.
>>
>>However, if I keep the browser window open, and even if I restart Tomcat,
>>when I try to run monster from the JSP page again, it does not run!
>>The JSP
>>page creates the directory for the output files, but still, monster
>>itself
>>actually doesn't execute.
>>
>>I've been browsing through the web, and I've read somewhere that if a
>>servlet starts an external thread, then that thread itself will
>>persist even
>>if the servlet is reloaded.  Is this true?
>>
>>If is I can see that I need to actually find this thread and kill it.
>>For
>>even if monster itself has finished running, the process wont run
>>again.  It
>>takes a few restarts of tomcat and reloading of the browser before i
>>can get
>>monster to run again, and I'm sure it's something to do with thread
>>persistence.
>>
>>Does anyone have any insight?
>>Thanks
>>Sam
>>
>>_________________________________________________________________
>>Add photos to your messages with MSN 8. Get 2 months FREE*.
>>http://join.msn.com/?page=features/featuredemail
>>
>>___________________________________________________________________________
>>
>>To unsubscribe, send email to [email protected] and include in the
>>body
>>of the message "signoff SERVLET-INTEREST".
>>
>>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>>Resources: http://java.sun.com/products/servlet/external-resources.html
>>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>>
>
>___________________________________________________________________________
>To unsubscribe, send email to [email protected] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>


_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.