I would like to restart tomcat service on Windows XP, I created a servlet which calls a batch file
public void doGet (HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
Process p = Runtime.getRuntime().exec("c:\restart_tomcat.bat");
}
following 2 lines added in my restart_tomcat.bat
net stop "Tomcat6"
net start "Tomcat6"
requesting the servlet URL stops tomcat server however it isn't started. However when I run batch file restart_tomcat.bat, works fine