flyboyut
asked on
uncommon issue with Runtime.getRuntime().exe Not standard problem
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(c mdstring). For example I can open
notepad.exe c:\\Apache\\Tomcat55\\weba pps\\Test\ \CommonXML \\yes.txt" as expected.
Network XP pro server using remote log-in: (This is a dead end - never works)
notepad.exe c:\\Apache\\Tomcat55\\weba pps\\Test\ \CommonXML \\yes.txt"
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
from
permission java.lang.RuntimePermissio n "accessClassInPackage.org. apache.tom cat.util.d igester";
to
permission java.lang.RuntimePermissio n "*";
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)
try
{
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
System.out.println("<ERROR >");
line = br.readLine();
System.out.println(line);
System.out.println("</ERRO R>");
int exitVal = proc.waitFor();
System.out.println("Proces s exitValue: " + exitVal);
} catch (Throwable t)
{
t.printStackTrace();
}
Any ideas?
I can launch and see exe's execute using Runtime.getRuntime().exe(c
notepad.exe c:\\Apache\\Tomcat55\\weba
Network XP pro server using remote log-in: (This is a dead end - never works)
notepad.exe c:\\Apache\\Tomcat55\\weba
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
from
permission java.lang.RuntimePermissio
to
permission java.lang.RuntimePermissio
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)
try
{
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
System.out.println("<ERROR
line = br.readLine();
System.out.println(line);
System.out.println("</ERRO
int exitVal = proc.waitFor();
System.out.println("Proces
} catch (Throwable t)
{
t.printStackTrace();
}
Any ideas?
If you want to launch "notepad", the service running Tomcat would probably need "Allow service to interact with desktop" permission.
ASKER
My final goal is not to launch notepad, but a VB script. This subsitution of notepad was an attempt to simplfy the problem for troubleshooting.
Another point : the vbscript I wish to start is on the server, and launches a test functionality from a product created by the calling application.
Another point : the vbscript I wish to start is on the server, and launches a test functionality from a product created by the calling application.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.