Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2014-08-14 01:18:28 -0400
committerGreg Wilkins2014-08-14 01:18:28 -0400
commita14d84338204fffaf0da7c2681271d6262a85100 (patch)
treec8ad408fba97944a4e8315ba5419e04249d2b1fa /jetty-osgi/jetty-osgi-boot/src
parentf81bb4c000a7558ace0b64110e27fbec16de1624 (diff)
downloadorg.eclipse.jetty.project-a14d84338204fffaf0da7c2681271d6262a85100.tar.gz
org.eclipse.jetty.project-a14d84338204fffaf0da7c2681271d6262a85100.tar.xz
org.eclipse.jetty.project-a14d84338204fffaf0da7c2681271d6262a85100.zip
ignored osgi-spdy tests
Diffstat (limited to 'jetty-osgi/jetty-osgi-boot/src')
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java11
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java78
2 files changed, 43 insertions, 46 deletions
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 32e5bf7223..1347c65563 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
@@ -156,6 +156,8 @@ public class DefaultJettyAtJettyHomeHelper
LOG.info("Configuring the default jetty server with {}",configURLs);
String home=properties.get(OSGiServerConstants.JETTY_HOME);
String base=properties.get(OSGiServerConstants.JETTY_BASE);
+ if (base==null)
+ base=home;
LOG.info("JETTY.HOME="+home);
LOG.info("JETTY.BASE="+base);
ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
@@ -163,10 +165,6 @@ public class DefaultJettyAtJettyHomeHelper
{
Thread.currentThread().setContextClassLoader(JettyBootstrapActivator.class.getClassLoader());
- //ensure jetty.base is set
- if (base==null)
- base=home;
-
// these properties usually are the ones passed to this type of
// configuration.
properties.put(OSGiServerConstants.MANAGED_JETTY_SERVER_NAME, OSGiServerConstants.MANAGED_JETTY_SERVER_DEFAULT_NAME);
@@ -184,6 +182,11 @@ public class DefaultJettyAtJettyHomeHelper
LOG.info("Default jetty server configured");
return server;
}
+ catch (Exception e)
+ {
+ LOG.warn(e);
+ throw e;
+ }
finally
{
Thread.currentThread().setContextClassLoader(contextCl);
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java
index c4bc8c529c..dc94d6d2f5 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/ServerInstanceWrapper.java
@@ -147,47 +147,42 @@ public class ServerInstanceWrapper
for (URL jettyConfiguration : jettyConfigurations)
{
- InputStream is = null;
- try
- {
- // Execute a Jetty configuration file
- Resource r = Resource.newResource(jettyConfiguration);
- if (!r.exists())
- {
- LOG.warn("File does not exist "+r);
- throw new IllegalStateException("No such jetty server config file: "+r);
- }
- is = r.getInputStream();
- XmlConfiguration config = new XmlConfiguration(is);
- config.getIdMap().putAll(id_map);
- config.getProperties().putAll(properties);
-
- // #334062 compute the URL of the folder that contains the
- // conf file and set it as a property so we can compute relative paths
- // from it.
- String urlPath = jettyConfiguration.toString();
- int lastSlash = urlPath.lastIndexOf('/');
- if (lastSlash > 4)
- {
- urlPath = urlPath.substring(0, lastSlash);
- config.getProperties().put(PROPERTY_THIS_JETTY_XML_FOLDER_URL, urlPath);
- }
-
- Object o = config.configure();
- if (server == null)
- server = (Server)o;
-
- id_map = config.getIdMap();
- }
- catch (SAXParseException saxparse)
- {
- LOG.warn("Unable to configure the jetty/etc file " + jettyConfiguration, saxparse);
- throw saxparse;
- }
- finally
- {
- IO.close(is);
- }
+ try(Resource r = Resource.newResource(jettyConfiguration))
+ {
+ // Execute a Jetty configuration file
+ if (!r.exists())
+ {
+ LOG.warn("File does not exist "+r);
+ throw new IllegalStateException("No such jetty server config file: "+r);
+ }
+
+ XmlConfiguration config = new XmlConfiguration(r.getURL());
+
+ config.getIdMap().putAll(id_map);
+ config.getProperties().putAll(properties);
+
+ // #334062 compute the URL of the folder that contains the
+ // conf file and set it as a property so we can compute relative paths
+ // from it.
+ String urlPath = jettyConfiguration.toString();
+ int lastSlash = urlPath.lastIndexOf('/');
+ if (lastSlash > 4)
+ {
+ urlPath = urlPath.substring(0, lastSlash);
+ config.getProperties().put(PROPERTY_THIS_JETTY_XML_FOLDER_URL, urlPath);
+ }
+
+ Object o = config.configure();
+ if (server == null)
+ server = (Server)o;
+
+ id_map = config.getIdMap();
+ }
+ catch (Exception e)
+ {
+ LOG.warn("Configuration error in " + jettyConfiguration);
+ throw e;
+ }
}
return server;
@@ -250,7 +245,6 @@ public class ServerInstanceWrapper
return _ctxtCollection;
}
-
/* ------------------------------------------------------------ */
public void start(Server server, Dictionary props) throws Exception
{

Back to the top