uncommon issue with Runtime.getRuntime().exe Not standard problem
Posted on 2006-05-10
Local XP pro PC with Tomcat 5.57 (This works on most any exe I try...is very forgiving)
I can launch and see exe's execute using Runtime.getRuntime().exe(cmdstring). For example I can open
notepad.exe c:\\Apache\\Tomcat55\\webapps\\Test\\CommonXML\\yes.txt" as expected.
Network XP pro server using remote log-in: (This is a dead end - never works)
fails, no error codes.
I've searched the web over, and have found numberious 'solutions', of which none have helped.
I know to try putting the parameters in an array, I have tried pasing the "cmd.exe /c notepad.exe....blah, blah....
I have used escaped quotes.
The tomcat logs show nothing.
I changed Tomcats management config file catalina.policy file
permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester";
permission java.lang.RuntimePermission "*";
I have unstalled and reinstalled tomcat to paths with no spaces in the name.
The only time I've been able to anything out of the network server is when I put a command line that has an exe the server cannot locate.
Then I get an error back the infamous 193, otherwise no matter what I throw at it, blinks and does nothing...doesn't lock up, just keeps on ticking.
Here is some sample code I've have used locally with success, and externally (network) with not success)
String cmd = " cmd.exe /c notepad.exe ";
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
InputStream stderr = proc.getErrorStream();
InputStreamReader isr = new InputStreamReader(stderr);
BufferedReader br = new BufferedReader(isr);
String line = null;rr
line = br.readLine();
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
} catch (Throwable t)