Hi!
I work with Apache1.3.3/JServ1.0, JSDK2.0, on Solaris2.6.  I try to execute
a shell script from my servlet. The script works for quite some time. When I
was running the servlet with JSDK2.0 servletrunner, it was waiting for the
script to finish and was showing results afterwards. With Apache/JServ - 
the servlet doesn't wait for the script any more, and I get an error -
IllegalThreadStateException. Could somebody, please, advise me on what is
wrong here?

Thanks a lot,
Marina

The error message:
(from jserv.log):
[19/07/1999 10:30:19:733 EDT] Initializing servlet: 'retrieve_frame' ;
initArgs: '{}'
[19/07/1999 10:30:19:734 EDT] retrieve_frame/RetrieveFrame: init
[19/07/1999 10:30:19:734 EDT] Calling service()
[19/07/1999 10:30:20:373 EDT] Sending response headers.
[19/07/1999 10:30:20:375 EDT] Status: 500 Internal Server Error
[19/07/1999 10:30:20:376 EDT] Servlet-Error:
java.lang.IllegalThreadStateException: process hasn't exited: process hasn't
exited
[19/07/1999 10:30:20:377 EDT] Content-Type: text/html
[19/07/1999 10:30:20:379] (ERROR) ajp11: Servlet Error:
java.lang.IllegalThreadStateException: process hasn't exited: process hasn't
exited
[19/07/1999 10:30:20:379] (ERROR) an error returned handling request via
protocol "ajpv11"
[19/07/1999 10:30:20:381 EDT] java.lang.IllegalThreadStateException: process
hasn't exited
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(Compiled Code)
        at java.lang.RuntimeException.<init>(Compiled Code)
        at java.lang.IllegalArgumentException.<init>(Compiled Code)
        at java.lang.IllegalThreadStateException.<init>(Compiled Code)
        at java.lang.UNIXProcess.exitValue(Compiled Code)
        at Retrieve.doCommand(Compiled Code)
        at Retrieve.work(Compiled Code)
        at RetrieveFrame.doPost(Compiled Code)
        at RetrieveFrame.doGet(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at javax.servlet.http.HttpServlet.service(Compiled Code)
        at org.apache.jserv.JServConnection.processRequest(Compiled Code)
        at org.apache.jserv.JServConnection.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)

Here is some code:
  I have a RetriveFrame servlet - it call the work() method of Retrive
class. There I call doCommand method , execute the shell script, get
results, format an output HTML page and return. Then RetriveFrame is
supposed to return this HTML page to the client.


  public int doCommand() {
        Process process = null;
        Runtime runtime = Runtime.getRuntime();
        String [] command = new String [4];
         .....
          command[0] = new
String("/export/home/users/pmarina/www/Client-development/find_by_firm_perso
n_city.csh");
          command[1] = firm_name;
          command[2] = person_name;
          command[3] = city;

        try {
          process = runtime.exec(command);
          in = new BufferedReader (new InputStreamReader(
process.getInputStream() ));
        }
        catch (IOException e){
          System.out.println("doCommand() exception: " + e.toString());
        }


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to