Link to home
Start Free TrialLog in
Avatar of flyboyut
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(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)
notepad.exe c:\\Apache\\Tomcat55\\webapps\\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.RuntimePermission "accessClassInPackage.org.apache.tomcat.util.digester";
to
 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)


      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("</ERROR>");
            int exitVal = proc.waitFor();
            System.out.println("Process exitValue: " + exitVal);
        } catch (Throwable t)
          {
            t.printStackTrace();
          }

  Any ideas?
Avatar of sleep_furiously
sleep_furiously

If you want to launch "notepad", the service running Tomcat would probably need "Allow service to interact with desktop" permission.
Avatar of flyboyut

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.  
ASKER CERTIFIED SOLUTION
Avatar of sleep_furiously
sleep_furiously

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial