From efdff3ecfe730912945e0638f7cfd02125922381 Mon Sep 17 00:00:00 2001 From: Hugues Malphettes Date: Thu, 14 Jan 2010 06:17:36 +0000 Subject: [PATCH] fix a trivial bug in the initialization of the jetty server. git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1197 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../internal/webapp/WebappRegistrationHelper.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebappRegistrationHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebappRegistrationHelper.java index d365f78c855..9f0352c61e4 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebappRegistrationHelper.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/webapp/WebappRegistrationHelper.java @@ -275,9 +275,9 @@ class WebappRegistrationHelper String jettyetc = System.getProperty(OSGiWebappConstants.SYS_PROP_JETTY_ETC_FILES,"etc/jetty.xml"); StringTokenizer tokenizer = new StringTokenizer(jettyetc,";,"); - Map id_map = new HashMap(); - id_map.put("Server","_server"); - Map properties = new HashMap(); + Map id_map = new HashMap(); + id_map.put("Server",_server); + Map properties = new HashMap(); properties.put("jetty.home",jettyHome); properties.put("jetty.host",System.getProperty("jetty.host","")); properties.put("jetty.port",System.getProperty("jetty.port","8080")); @@ -382,6 +382,13 @@ class WebappRegistrationHelper break; } } + if (_provider == null) { + //why not creating it on the fly? + //I think it is nice to create it on the fly: + //this way we can reuse the original jetty.xml + _provider = new OSGiAppProvider(); + _deploymentManager.addAppProvider(_provider); + } } if (_ctxtHandler == null || _provider==null)