Hi
I am having problems using the DispatcherServlet with the fact that the init method in HttpServletBean is set to final, and the initServletBean in FrameworkServlet is also set to final.
My problem stems from the fact that the app server I am using, Sybase EAServer, has a bug, whereby if an init method in a servlet takes more than 60s to complete, EAServer jumps in and starts initialising the next servlet in the <load-on-startup> sequence :evil:. This means that my DispatcherServlets are starting before the ContextLoaderServlet is ready to service them, causing all sorts of errors.
Sybase's suggested workaround was to synchronise the init methods of my servlets (an ugly but effective sledgehammer :roll: ). My approach was to subclass ContextLoaderServlet and DispatcherServlet and override the init method with:
But this does not work on the DispatcherServlet as all the init methods are final. Putting aside my dislike for making any method final unless overriding it will lead directly to a reversal in the laws of physics and ultimately the complete extinction of all life on earth, I was wondering why the spring code makes so many methods final, making customisation of some behaviour very difficult? (I have run into similar difficulties in other areas of the code)Code:public void init() throws ServletException { synchronized (ServletInitLock.class) { super.init(); } }


Reply With Quote