Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] ServletContextListener defers server start

Sounds like the initial deployment on Server.start() is the reason you are experiencing this.

Your environment would need to delay deployment until after the server has started up.
That would be a new feature / configuration (and not that hard to implement either)
Can you file an issue for a new feature at https://github.com/eclipse/jetty.project/issues

And the extra requirement of a 503 before the webapp is available is a new feature that Jetty does not have.
That would likely need to be a custom Handler at the end of your Handler tree (but before the DefaultHandler) to
check the submitted context path and return 503 in those situations. 
(as if it reached that custom handler, that means the webapp isn't there yet)
That can also be a new feature, submit the idea at https://github.com/eclipse/jetty.project/issues

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Fri, Oct 4, 2019 at 9:02 AM Dirk Olmes <dirk.olmes@xxxxxxxxxx> wrote:
Hi,

I'm using an embedded Jetty to set up a servlet context. My code looks
quite similar to what's in the "Embedding ServletContexts" section of
the "Embedding Jetty" chapter of the Jetty docs.

I noticed that the server (more correctly the ServerConnector) won't be
ready to accept connections unless my servlets have started up. Now I
have a ServletContextListener that takes a long time to start up.

Would it be possible to configure Jetty in such a way that it already
accepts connections and answers e.g. with a 503 status until the servlet
context is finally up and running?

-dirk
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top