You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HTTPProvider.bootLift method is catching javax.servlet.UnavailableException, which it should not because the exception is here to tell the application server that the servlet failed to boot.
In Lift 2.6.x, it was even worse because the method was catching ALL exceptions, even Errors.
How to reproduce
Throws a javax.servlet.UnavailableException in Lift boot() method. The exception is caught during boot and the log displays a big warning message:
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
******** Failed to Boot! Your application may not run properly
[here the exception message]
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------
Use case
I'm doing a lot of initialization and resource availability checking at bootstrap, and it was natural to put them in Lift boot() method. The UnavailableException was a conventionnal way to tell the web-app server that something went horribly wrong during init and the servlet is unavailable. Jetty (for ex) will then respond with "error 503: service unavailable" when a query is done to that app.
Workaround
For now, I added a ServletContextListener where I'm doing the init and throw UnavailableException, but it splits the initialization logic between it and Lift boot() and make the code harder to follow.
The text was updated successfully, but these errors were encountered:
This code adds special handling for javax.servelet.UnavailableException.
This exception is an idiomatic way to signal a full abort to the Java
Application server running the application.
Please see #1843 for more information.
Mailing List thread: https://groups.google.com/forum/#!topic/liftweb/BHYjE5C-kIk
The HTTPProvider.bootLift method is catching javax.servlet.UnavailableException, which it should not because the exception is here to tell the application server that the servlet failed to boot.
In Lift 2.6.x, it was even worse because the method was catching ALL exceptions, even Errors.
How to reproduce
Throws a javax.servlet.UnavailableException in Lift boot() method. The exception is caught during boot and the log displays a big warning message:
Use case
I'm doing a lot of initialization and resource availability checking at bootstrap, and it was natural to put them in Lift boot() method. The UnavailableException was a conventionnal way to tell the web-app server that something went horribly wrong during init and the servlet is unavailable. Jetty (for ex) will then respond with "error 503: service unavailable" when a query is done to that app.
Workaround
For now, I added a ServletContextListener where I'm doing the init and throw UnavailableException, but it splits the initialization logic between it and Lift boot() and make the code harder to follow.
The text was updated successfully, but these errors were encountered: