I have an application, for the maintenance of which, I have created a jsp page with tomcat, so that application can be started/stopped from browser. Now to start the application, what I need to do is, get the Runtime object, and call the exec method of runtime, passing as argument "java -classpath myclasspath myApp 1>/var/log/app.log 2>&1 &". This application remains on continuously, thats why I need to put it in background and redirect the output/error logs. Now, when I execute this command using exec method, it doesn't return from the exec call, neither does any output/error goes into the specified log file, though the processes of the application are started. Whats I am trying to do here is that I am trying to invoke my application in its own jvm, from the jvm of tomcat. Why is it not returning from this call? What could be the solution to this? Waiting for replies, Ankit.
If the application remains on continuously, then the Process created by exec continues to monitor it - that hangs up the JSP thread. You might start the app by executing a batch file, that can return as soon as the command executes. Bill
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad: