diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-default.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-default.xml index 68a662d0338..30f8ea9d186 100644 --- a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-default.xml +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-default.xml @@ -1,64 +1,29 @@ + - - + - - + 10 200 + false - - - - - - - - - - - 300000 - 2 - false - 8443 - 20000 - 5000 - - - - - - - - - - - - - - - - - - @@ -80,45 +45,6 @@ - - - - - - - - - - - - - - - org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern - .*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$ - - - - - - - 5 - /contexts - - - - - - - - - @@ -127,8 +53,13 @@ true true 1000 + false + false + - + + + java.naming.factory.initial diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-deployer-default.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-deployer-default.xml new file mode 100644 index 00000000000..f05b31c8e16 --- /dev/null +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-deployer-default.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern + .*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$ + + + + + + + 5 + /contexts + + + + + + + + + + + + + diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-nested-default.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-nested-default.xml index 67d84e9df8f..c11cec11920 100644 --- a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-nested-default.xml +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-nested-default.xml @@ -2,11 +2,11 @@ - - + + - + @@ -31,83 +31,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern - .*/jsp-api-[^/]*\.jar$|.*/jsp-[^/]*\.jar$ - - - - - - - 5 - /contexts - - - - - - - - - - - - - - true - true - true - 1000 - - - - java.naming.factory.initial - - - - java.naming.factory.url.pkgs - - - diff --git a/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-selector-default.xml b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-selector-default.xml new file mode 100644 index 00000000000..46ccc85f525 --- /dev/null +++ b/jetty-osgi/jetty-osgi-boot/jettyhome/etc/jetty-osgi-selector-default.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + 300000 + 2 + false + 8443 + 20000 + 5000 + + + + + diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java index 5d7dd067004..2503c9de8d5 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java @@ -77,6 +77,16 @@ public class DefaultJettyAtJettyHomeHelper * configuration. */ public static final String SYS_PROP_JETTY_PORT_SSL = "jetty.port.ssl"; + + /** + * Set of config files to apply to a jetty Server instance if none are supplied by SYS_PROP_JETTY_ETC_FILES + */ + public static final String DEFAULT_JETTY_ETC_FILES = "jetty-osgi-default.xml,jetty-osgi-selector-default.xml,jetty-osgi-deployer-default.xml"; + + /** + * Default location within bundle of a jetty home dir. + */ + public static final String DEFAULT_JETTYHOME = "/jettyhome"; /** * Called by the JettyBootStrapActivator. If the system property jetty.home @@ -216,8 +226,9 @@ public class DefaultJettyAtJettyHomeHelper */ private static String getJettyConfigurationURLs(Bundle configurationBundle) { - String jettyetc = System.getProperty(SYS_PROP_JETTY_ETC_FILES, "etc/jetty.xml"); - StringTokenizer tokenizer = new StringTokenizer(jettyetc, ";,", false); + String files = System.getProperty(SYS_PROP_JETTY_ETC_FILES, DEFAULT_JETTY_ETC_FILES); + + StringTokenizer tokenizer = new StringTokenizer(files, ";,", false); StringBuilder res = new StringBuilder(); while (tokenizer.hasMoreTokens()) @@ -225,22 +236,25 @@ public class DefaultJettyAtJettyHomeHelper String etcFile = tokenizer.nextToken().trim(); if (etcFile.startsWith("/") || etcFile.indexOf(":") != -1) { + //file path is absolute appendToCommaSeparatedList(res, etcFile); } else { + //relative file path Enumeration enUrls = BundleFileLocatorHelper.DEFAULT.findEntries(configurationBundle, etcFile); // default for org.eclipse.osgi.boot where we look inside // jettyhome for the default embedded configuration. // default inside jettyhome. this way fragments to the bundle // can define their own configuration. - if ((enUrls == null || !enUrls.hasMoreElements()) && etcFile.endsWith("etc/jetty.xml")) + if ((enUrls == null || !enUrls.hasMoreElements()) && etcFile.endsWith("-default.xml")) { - enUrls = BundleFileLocatorHelper.DEFAULT.findEntries(configurationBundle, "/jettyhome/etc/jetty-osgi-default.xml"); - LOG.debug("Configuring jetty with the default embedded configuration:" + "bundle: " + String tmp = DEFAULT_JETTYHOME+"/etc/"+etcFile; + enUrls = BundleFileLocatorHelper.DEFAULT.findEntries(configurationBundle, tmp); + LOG.info("Configuring jetty with the default embedded configuration:" + "bundle: " + configurationBundle.getSymbolicName() - + " config: /jettyhome/etc/jetty-osgi-default.xml"); + + " config: "+tmp); } if (enUrls == null || !enUrls.hasMoreElements()) { diff --git a/jetty-osgi/jetty-osgi-servletbridge/src/main/java/org/eclipse/jetty/osgi/servletbridge/FrameworkLauncherExtended.java b/jetty-osgi/jetty-osgi-servletbridge/src/main/java/org/eclipse/jetty/osgi/servletbridge/FrameworkLauncherExtended.java index 8dd8c8ef4d2..e880b3f0f9c 100644 --- a/jetty-osgi/jetty-osgi-servletbridge/src/main/java/org/eclipse/jetty/osgi/servletbridge/FrameworkLauncherExtended.java +++ b/jetty-osgi/jetty-osgi-servletbridge/src/main/java/org/eclipse/jetty/osgi/servletbridge/FrameworkLauncherExtended.java @@ -291,11 +291,13 @@ public class FrameworkLauncherExtended extends FrameworkLauncher String etcJettyXml = System.getProperty("jetty.etc.config.urls"); if (etcJettyXml == null) { + etcJettyXml = "etc/jetty.xml"; if (new File(jettyHome, "etc/jetty-osgi-nested.xml").exists()) { - System.setProperty("jetty.etc.config.urls", "etc/jetty-osgi-nested.xml"); - props.setProperty("jetty.etc.config.urls", "etc/jetty-osgi-nested.xml"); + etcJettyXml += ",etc/jetty-osgi-nested.xml"; } + System.setProperty("jetty.etc.config.urls", etcJettyXml); + props.setProperty("jetty.etc.config.urls", etcJettyXml); } String startLevel = System.getProperty("osgi.startLevel"); if (startLevel == null)