Re: [jetty-users] ServletContextListener defers server start

2019-10-08 Thread Dirk Olmes
On 10/7/19 9:15 PM, Joakim Erdfelt wrote: > I went ahead and added an example to the Embedded Jetty Cookbook. > > https://github.com/jetty-project/embedded-jetty-cookbook/blob/master/src/main/java/org/eclipse/jetty/cookbook/DelayedWebAppDeployExample.java > > That explains how to accomplish what

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Dirk Olmes
On 10/7/19 4:35 PM, Bill Ross wrote: > Would anything like these chunks from my code work for you? The secret > is checking status in doGet(). Thanks, a lot Bill. This looks quite similar to the solution I currently have in place. However, our app consists of more than one servlet and I had to

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Joakim Erdfelt
I went ahead and added an example to the Embedded Jetty Cookbook. https://github.com/jetty-project/embedded-jetty-cookbook/blob/master/src/main/java/org/eclipse/jetty/cookbook/DelayedWebAppDeployExample.java That explains how to accomplish what you need. Joakim Erdfelt / joa...@webtide.com On

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Bill Ross
(and return after the 503) On 10/7/19 7:35 AM, Bill Ross wrote: Would anything like these chunks from my code work for you? The secret is checking status in doGet(). public class GetMult extends HttpServlet {     private ServletData servletData;     public void init(ServletConfig config)

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Bill Ross
Would anything like these chunks from my code work for you? The secret is checking status in doGet(). public class GetMult extends HttpServlet {     private ServletData servletData;     public void init(ServletConfig config) throws ServletException {     servletData = ServletData.get();

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Dirk Olmes
On 10/7/19 11:21 AM, Bill Ross wrote: > Why not have a ContextHandler that starts a setup thread on init, and > answers 503 until that thread is done? That's sort of what I currently do (starting a setup thread from the main servlet's init method) but that causes all kinds of trouble because the

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Bill Ross
Why not have a ContextHandler that starts a setup thread on init, and answers 503 until that thread is done? Bill On 10/7/19 2:10 AM, Dirk Olmes wrote: On 10/5/19 2:07 AM, Greg Wilkins wrote: Dirk, Hi Greg, Note that you can actually achieve this with just a little bit of work: Write a

Re: [jetty-users] ServletContextListener defers server start

2019-10-07 Thread Dirk Olmes
On 10/5/19 2:07 AM, Greg Wilkins wrote: > Dirk, Hi Greg, > Note that you can actually achieve this with just a little bit of work: > > Write a simple context (extend context handler) that all it does is send a > 503 with whatever message you want. > Deploy both that context and your context at

Re: [jetty-users] ServletContextListener defers server start

2019-10-04 Thread Greg Wilkins
Dirk, Note that you can actually achieve this with just a little bit of work: Write a simple context (extend context handler) that all it does is send a 503 with whatever message you want. Deploy both that context and your context at the same context path. The 503 context will handle all the

Re: [jetty-users] ServletContextListener defers server start

2019-10-04 Thread Joakim Erdfelt
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

[jetty-users] ServletContextListener defers server start

2019-10-04 Thread Dirk Olmes
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