Bijumon
08-12-2008, 02:45 AM
I am not able to run a Servlet that calls an exe file using the follwing code. trial.exe is was built from a C program and it is simply a program that creates a text file with some content. I am using Tomcat 6.0 and JDK 1.5 on a Windows XP.
try
{
Runtime rt=Runtime.getRuntime();
String[] command = {"C://Tomcat 6.0//webapps//ROOT//WEB-INF//classes//trial.exe"};
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
}
catch(Throwable t)
{
// System.out.print(t.getMessage());
}
Before running the code on Tomcat I've compiled the code above in a simple java programe and it executed without any problem.
Then I compiled the code within a servlet. No luck. Then I treid the following options:
Executed the Tomcat service under the context of a user by specifying a user(Log On option) for the Tomcat service.
Then with Local System Account, selecting “Allow service to interact with desktop”.
this time also, no luck. Can somebody help me on this please BJJ?
try
{
Runtime rt=Runtime.getRuntime();
String[] command = {"C://Tomcat 6.0//webapps//ROOT//WEB-INF//classes//trial.exe"};
Process p = Runtime.getRuntime().exec(command);
p.waitFor();
}
catch(Throwable t)
{
// System.out.print(t.getMessage());
}
Before running the code on Tomcat I've compiled the code above in a simple java programe and it executed without any problem.
Then I compiled the code within a servlet. No luck. Then I treid the following options:
Executed the Tomcat service under the context of a user by specifying a user(Log On option) for the Tomcat service.
Then with Local System Account, selecting “Allow service to interact with desktop”.
this time also, no luck. Can somebody help me on this please BJJ?