Hello everyone.
The goal I'm
struggling to achieve is stopping jetty if my web app is
unavailable:
2019-05-01
16:17:30.339:INFO:oejs.Server:main: jetty-9.4.5.v20170502
2019-05-01 16:17:30.363:INFO:oejdp.ScanningAppProvider:main:
Deployment monitor
[file:///usr/local/jetty-distribution-9.4.5.v20170502/webapps/] at
interval 1
2019-05-01 16:17:34.435:INFO:oeja.AnnotationConfiguration:main:
Scanning elapsed time=3706ms
2019-05-01 16:17:34.436:WARN:oejw.WebAppContext:main: Failed
startup of context
o.e.j.w.WebAppContext@6a024a67{/rest,file:///usr/local/jetty-distribution-9.4.5.v20170502/work/jetty-0.0.0.0-8406-rest.war-_
rest-any-/webapp/,UNAVAILABLE}{/rest.war}
I guess
`startWithUnavailable` config option is what I'm looking for, but
apparently I'm not setting it correctly. Can someone please tell
me
how the xml should look like and where to place it?
Another option I found is `throwUnavailableOnStartupException`
(set in
jetty-env.xml). That works in that the
exception bubbles up from WebAppContext -
https://github.com/eclipse/jetty.project/blob/jetty-9.4.5.v20170502/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppContext.java#L557,
but according to logs it stops at
https://github.com/eclipse/jetty.project/blob/jetty-9.4.5.v20170502/jetty-deploy/src/main/java/org/eclipse/jetty/deploy/DeploymentManager.java
and jetty remains running.
Any help is much
appreaciated. Thank you!
Sincerely, Pavel