The Equinox Jetty bundle should not be explicitly started anymore.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / kernel / CmsDeployment.java
index 30d283c580583ed090df96b2694ad093bd414b89..20418ec4d21e803890e838abdfaec1b092a24337 100644 (file)
@@ -34,6 +34,7 @@ import org.argeo.node.security.CryptoKeyring;
 import org.argeo.node.security.Keyring;
 import org.argeo.osgi.useradmin.UserAdminConf;
 import org.argeo.util.LangUtils;
+import org.eclipse.equinox.http.jetty.JettyConfigurator;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
@@ -192,6 +193,13 @@ public class CmsDeployment implements NodeDeployment {
        public void shutdown() {
                if (nodeHttp != null)
                        nodeHttp.destroy();
+
+               try {
+                       JettyConfigurator.stopServer(KernelConstants.DEFAULT_JETTY_SERVER);
+               } catch (Exception e) {
+                       log.error("Cannot stop default Jetty server.", e);
+               }
+
                if (deployConfig != null) {
                        new Thread(() -> deployConfig.save(), "Save Argeo Deploy Config").start();
                }