uncommon issue with Runtime.getRuntime().exe   Not standard problem

Posted on 2006-05-10
Last Modified: 2010-03-04
Local XP pro PC with Tomcat 5.57  (This works on most any exe I 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  
 permission java.lang.RuntimePermission "";
 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)

  Any ideas?
Question by:flyboyut
    LVL 10

    Expert Comment

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

    Author Comment

    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.  
    LVL 10

    Accepted Solution

    If you want to simplify testing, its probably better to call a substitute a console application instead of "Notepad" -- calling a GUI application complicates the situation because it will require special rights.  Maybe try running "tasklist" and see if it lists itself.

    So if you are using a VB Script, be sure to use cscript and not wscript to run it.


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now