I have a crazy request about restarting tomcat server through my webapp. I was searching for nearly 2 days about this and all i found are executing external batch file or ca
Why not just create a script an call it trough Runtime.exec? Seems quite optimal to me. Since restarting tomcat will terminate the Java VM, it doesn't really make sense to have it as an API call.
You can connect to the shutdown port tomcat opens and issue the shutdown command.
See http://tomcat.apache.org/tomcat-7.0-doc/config/server.html
Best solution we have found is to use the Java Service Wrapper
It provides multiple benefits in managing the lifecyle of your server - including what you are trying to achieve - and in particular the ability to easily register as a Windows service.