----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Environment :

WinNT 4.0 SP 6
Apache 1.3.6
JServ 1.1
JDK 1.1.8
JSDK2.0

I have got a servlet which does not work when it calls
Runtime.exec(path\file.exe) on above prescribed environment.
The point is that the same code works fine with servletrunner.
It also works fine if I do the same thing (same environment) but  Win98.
So it seems the problem stands between WinNT and JServ 1.1
Here is a very small servlet, that someone is very pleased to use to test my
problem.

import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;

public class WontWorkOnJServNTServlet extends HttpServlet
{
   String cmd = "d:\\Winnt\\Notepad.exe";
//   String cmd = "c:\\Windows\\Notepad.exe";
   public void service(HttpServletRequest req, HttpServletResponse resp)
    throws IOException, ServletException {
      try {
          Runtime rr = Runtime.getRuntime();
          Process pp = rr.exec(cmd);
          // Wait for process to exit
          try {
              pp.waitFor();
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
      } catch (IOException e) {
          System.err.println(e);
      }
   resp.getWriter().println("Did it work ?");
   }
}

Help will be really appreciated....as I'm completely exhausted.

thank you

Ilirjan







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

Reply via email to