I am trying to execute a command line program (using WinNT 4, SP5, Apache JServ, IBM
HTTP Server 1.3.6, jdk 1.1.7, jsdk 2.0) that looks something like :
Process pr=Runtime.getRuntime().exec("c:\\path_to_exec\\the.exe");
Before I continue, I'd like to mention that using the same code in standalone mode
works fine.
Now, when I use the above command, without any arguments, I get a "CreateProcess"
(error=5) exception. However, using the same command but now with arguments the called
application ("the.exe") just hangs and only when I kill the process associated with
"the.exe" the servlet continues.
It seems not to matter whether I use pr.waitFor() or not, the servlet refuses to
continue anyway (I use a LineNumberReader lnr=new LineNumberReader(new
InputStreamReader(pr.getInputStream())); but I don't think that matters).
The arguments I pass in as a String array, like
String[] cmdLine=new String[2];
..
cmdLine[0]="c:\\path_to_exec\\the.exe";
cmdLine[1]=an_argument;
As said before, in a standalone console java-app it works fine. I can read the output
of the app "the.exe", with or without arguments.
Any suggestions are highly appreciated.
Peter
___________________________________________________________________________
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