Re: External process does not exit
To chossen...@yahoo.com,
If I run it manuaaly through PDF creator then too it takes less than a
minute.
I tried invoking calc.exe, in the Java file and calling the function
from JSP, I can see the calc.exe is running in MS Task Manager but it
is not visible. nor does it stop executing when I call for a long time
without giving any output. I have tried this using servlet too as I
want to execute this on my server and not the client m/c.
Same thing happens for PDFCreator too. If I call Thread.sleep(1000)
and then p.destroy();, the PDF Creator is stopped immediadtely but
does not create the pdf file. :(
To John B. Matthews,
If I call PDF Creator from the cmd line directly (not through JAVA) it
gives the required o/p. But I'm invoking a Java function through JSP
which executes the PDFCreator.exe through cmd line it doesn't work.
cmd.exe it invoked as I can see it in my Task Manager, but nothing
else happens.
Code is:
public void print()
{
String cmd="C:\\WINDOWS\\system32\\cmd.exe /C C:\\Program Files\
\PDFCreator\\PDFCreator.exe /NOSTART /PF
\"C:\\Program Files\\Apache Software Foundation\\Tomcat 5.5\\webapps\
\Reports\\1.doc\"";
try{
p = r.getRuntime().exec(cmd);
stdInput = new BufferedReader(new InputStreamReader(p.getInputStream
()));
stdError = new BufferedReader(new InputStreamReader(p.getErrorStream
()));
System.out.println("Input="+stdInput);
System.out.println("Error="+stdError);
} catch(IOException ioe){System.out.println("Exception="+ioe);
}
The PDF creator is executing but does not give any o/p.
Im using thesame command as given in help file of PDF Creator.