1

I'm trying to handle a use case where my server is muted and a user try to access it. Today when the server is muted the user get the jetty's default error page for 503 (HTTP ERROR: 503). I would like to replace this error page with a custom error page. I do have custom pages on my web.xml, but it is not loaded (since the server is muted). I tried writing my own error handler that extends ErrorPageErrorHandler, and I registered it on jetty-web.xml O debug I see that my class is loaded, but it does not activate when the error happens.

I'm muting the server by stopping my DB service. It seems that this causes the ContextLoader to fail. Here is a partial stack trace, any insights would help:

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:643)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:233)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1213)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:589)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
at org.eclipse.jetty.server.Server.doStart(Server.java:261)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at com.hp.qc.JettyRunner.startJetty(JettyRunner.java:73)
at com.hp.qc.JettyRunner.main(JettyRunner.java:31)
Vinay
  • 6,891
  • 4
  • 32
  • 50

0 Answers0