Starting and stopping BASE in Tomcat is not implemented correctly
When starting up BASE there are two servlets that are configured to be started immediately.
While this is ok at startup time, I noticed that when stopping Tomcat the servlets are destroyed in the same order as they were started up. This means that when the extensions system is about to shut down, the BASE main app has already been closed so any extensions that need to perform actions (eg. services) will not be able to do anything.
I also found the following http://stackoverflow.com/questions/6874512/order-of-calling-destroy-method-on-servlets-filters discussion and it seems like there is no guarantee that a servlet is kept alive at all times. Luckily we have not noticed any strange re-starts of BASE...
The solution to use a servlet context listener is also mentioned and I found the following code example: http://www.mkyong.com/servlet/what-is-listener-servletcontextlistener-example/