You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sasha Borodin <sa...@whoissasha.com> on 2003/09/11 18:51:58 UTC
ServletContextListener fails - how to make app unavailable?
I've tried searching for this issue in the tomcat-user archives; I found
general theory but not how to implement it. Specifically:
If there's a problem within contextIntitialized(), I would want the app to
return HTTP 500 or something. But the ServletContextListener interface does
not declare any Exceptions thrown. Thus I can't declare any in my subclass.
Yet if I try to just catch an Exception, log, and rethrow a general
ServletException, I can't compile cause ("must handle or declare...").
So how do I notify Tomcat that there's a problem, and that the context
should be made unavailable?
Thanks,
-Sasha