Okay, we have a weird situation. We have an app that has been in maintenance mode for a long time. A recent change moved some code that was in teh servlet context listener to the servlet init method. The context listener was firing first of course, and the code required some resources that weren't available until servlet init.
Anyway, moving this code caused us to either notice something we never noticed before or cause something. The something is that under some conditions, the servlet init is throwing an exception where the stack trace reveals that it was invoked as a downstream consequence of RequestDispatcher.forward(). This is in an application that already ran the initialization and has load-at-startup on in web.xml.
This baffles me. If you ran init already, why would forward() call init() again?
Brian Mulholland wrote: The something is that under some conditions, the servlet init is throwing an exception where the stack trace reveals that it was invoked as a downstream consequence of RequestDispatcher.forward(). This is in an application that already ran the initialization and has load-at-startup on in web.xml.
how you are getting the request and response either in ServletContextListener or init of servlet?
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: RequestDispatcher.forward() is init()ing servlet?