Sokrates Documentation - Stopping and Restarting

Avoid stopping the servlet runner by hitting ^C in the console window because this will kill the process without disconnecting properly from the webserver and without closing the running servlet instances.

For stopping the servlet runner create an empty file named shutdown in the runner directory. After some seconds the runner will shutdown.

If you need to reload the configuration (after changes in the configuration files or after adding/removing servlets) you can restart the whole servlet runner by creating an emtpy file named restart in the runner directory. After some seconds the runner will shutdown all servlet containers and then restart itself.

We created 2 batch files named restart.cmd and stop.cmd which basically doing the same thing.

Note: although you can replace your servlet classes or .jar files during runtime you cannot exchange the main runner.jar  archive while the servlet runner is working (it is locked by the Java Virtual Machine). But you can do it with a trick (especially for remote administration) by creating a more clever version of the runner.cmd

:10
 jre -cp runner.jar;javax.jar net.conacom.servletrunner.main.Runner
 if not exist _runner.jar goto 20
 del runner.jar
 ren _runner.jar runner.jar
 goto 10
:20
 exit


This version will look for a file named _runner.jar which may contain a newer or bugfixed version of Sokrates in the current directory and if found, it will delete the old version, renaming the new file and then restart the servlet runner.

 << Installation <<     >> Adding new Servlets >>
Main - Installation - Stopping and Restarting - Adding New Servlets - Better Structures - How does it work ?Sessions -