Problem using exec() from Java servlet
- From: "hust6" <mhust6@xxxxxxxxx>
- Date: 8 Aug 2006 14:59:26 -0700
I have been struggling with a problem for the past couple of days, and
am looking for any help that can be offered.
I have a servlet that I need to access a file in my companies version
manager software. The tomcat server is running on my machine, but when
it tries to execute the command line argument, I am getting the
following error:
java.io.IOException: CreateProcess: pcli -h error=5
Note that this error ONLY occurs when executing from a servlet. If I
just run it in Eclipse, for example, it runs fine.
In the end I obvioisly want to be doing something a bit more complex
than that but here, I am trying to run the help command on pcli.exe.
That executable is on a different machine than the server, but I have
set all necessary system properties prior to executing the command.
Here is my code:
//Set system properts
.....
System.setProperty("Path","directory containin pcli.exe");
//Run command
Runtime.getRuntime().exec("pcli -h");
I don't feel like doing this should be so complex, but I can't seem to
find the problem. Could it be a server security issue? ANY
suggestions offered will be greatly appreciated.
.
- Follow-Ups:
- Re: Problem using exec() from Java servlet
- From: Greg R. Broderick
- Re: Problem using exec() from Java servlet
- Prev by Date: jni - grab text in another non java program
- Next by Date: L2FProd - property *** component...Design question...
- Previous by thread: jni - grab text in another non java program
- Next by thread: Re: Problem using exec() from Java servlet
- Index(es):