Hi Michael, I don't believe there is currently any configuration for the Apache Felix Jetty Based Http Service that would do that automatically.
It seems to me that there are a couple of options that you may consider: 1. A "fail before startup" solution where you could utilize some other tooling in your startup script to check if the TCP port is already being used before attempting to launch the sling launchpad. 2. A "fail during startup" solution where you could modify the jetty http bundle code (and optional configuration?) to catch the specific BindException and initiate an orderly shutdown when that happens. The felix project should consider any patches you submit for consideration to be included in the next release. 3. A "fail after monitor" solution where your distribution could provide your own custom OSGi component that waits for a duration for all required services to become available. If the monitored required services do not become available then initiate an orderly shutdown. Perhaps some integration with the felix "healthcheck" apis could be useful here? Regards, Eric On Tue, Apr 27, 2021 at 8:03 AM Lescisin, Michael <michael.lesci...@uhn.ca> wrote: > Hi there, > > I was wondering if somebody could kindly help me with the following issue. > We are developing a clinical archive based on Apache Sling ( > https://github.com/ccmbioinfo/lfs) and are using the Sling Launchpad to > load all artifacts. One such artifact is org.apache.felix.http.jetty > (specified in > https://github.com/ccmbioinfo/lfs/blob/dev/distribution/src/main/provisioning/99-standalone.txt) > which (by default) binds to and listens on TCP port 8080. When another > process is listening on this port and thus causes > org.apache.felix.http.jetty to be unable to bind to this port, as expected, > I see java.net.BindException: Address already in use in > sling/logs/error.log. However, despite this error, the rest of the > artifacts are loaded, and the executable JAR does not terminate. > > Could someone kindly explain how Sling Launchpad can be reconfigured so > that the executable JAR will terminate if org.apache.felix.http.jetty > throws a java.net.BindException? > > Thank you, > > Michael > > This e-mail may contain confidential and/or privileged information for the > sole use of the intended recipient. > Any review or distribution by anyone other than the person for whom it was > originally intended is strictly prohibited. > If you have received this e-mail in error, please contact the sender and > delete all copies. > Opinions, conclusions or other information contained in this e-mail may > not be that of the organization. > > If you feel you have received an email from UHN of a commercial nature and > would like to be removed from the sender's mailing list please do one of > the following: > (1) Follow any unsubscribe process the sender has included in their email > (2) Where no unsubscribe process has been included, reply to the sender > and type "unsubscribe" in the subject line. If you require additional > information please go to our UHN Newsletters and Mailing Lists page. > Please note that we are unable to automatically unsubscribe individuals > from all UHN mailing lists. > > > Patient Consent for Email: > > UHN patients may provide their consent to communicate with UHN about their > care using email. All electronic communication carries some risk. Please > visit our website here< > https://www.uhn.ca/PatientsFamilies/Patient_Safety_Advocacy/Privacy/Documents/Email_consent_and_safety.pdf> > to learn about the risks of electronic communication and how to protect > your privacy. You may withdraw your consent to receive emails from UHN at > any time. Please contact your care provider, if you do not wish to receive > emails from UHN. >