diff options
19 files changed, 87 insertions, 111 deletions
diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml index 9a843df37e..fbdff7dbbd 100644 --- a/jetty-deploy/pom.xml +++ b/jetty-deploy/pom.xml @@ -25,7 +25,7 @@ </goals> <configuration> <instructions> - <Import-Package>org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*</Import-Package> + <Import-Package>org.eclipse.jetty.jmx.*;resolution:=optional,*</Import-Package> <_nouses>true</_nouses> </instructions> </configuration> diff --git a/jetty-http2/pom.xml b/jetty-http2/pom.xml index fb70630376..0e6574e1a7 100644 --- a/jetty-http2/pom.xml +++ b/jetty-http2/pom.xml @@ -32,7 +32,7 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.http2.*;version="9.1"</Export-Package> + <Export-Package>org.eclipse.jetty.http2.*"</Export-Package> <Import-Package>org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> <_nouses>true</_nouses> </instructions> diff --git a/jetty-nosql/pom.xml b/jetty-nosql/pom.xml index f283899a5b..92c7d77fd0 100644 --- a/jetty-nosql/pom.xml +++ b/jetty-nosql/pom.xml @@ -36,7 +36,7 @@ <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> - <Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.server.session.jmx;version="9.1";resolution:=optional,,org.eclipse.jetty.*;version="9.1",*</Import-Package> + <Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.server.session.jmx;resolution:=optional,org.eclipse.jetty.*,*</Import-Package> </instructions> </configuration> <extensions>true</extensions> 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 { diff --git a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml index fcb9ce3473..a0e9d1a11b 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml +++ b/jetty-osgi/test-jetty-osgi/src/test/config/etc/jetty-spdy.xml @@ -13,35 +13,7 @@ <!-- Consult the javadoc of o.e.j.spdy.server.http.ReferrerPushStrategy --> <!-- for all configuration that may be set here. --> <!-- =========================================================== --> - <New id="pushStrategy" class="org.eclipse.jetty.spdy.server.http.ReferrerPushStrategy"> - <!-- Uncomment to blacklist browsers for this push strategy. If one of the blacklisted Strings occurs in the - user-agent header sent by the client, push will be disabled for this browser. This is case insensitive" --> - <!-- - <Set name="UserAgentBlacklist"> - <Array type="String"> - <Item>.*(?i)firefox/14.*</Item> - <Item>.*(?i)firefox/15.*</Item> - <Item>.*(?i)firefox/16.*</Item> - </Array> - </Set> - --> - - <!-- Uncomment to override default file extensions to push --> - <!-- - <Set name="PushRegexps"> - <Array type="String"> - <Item>.*\.css</Item> - <Item>.*\.js</Item> - <Item>.*\.png</Item> - <Item>.*\.jpg</Item> - <Item>.*\.gif</Item> - </Array> - </Set> - --> - <Set name="referrerPushPeriod">5000</Set> - <Set name="maxAssociatedResources">32</Set> - </New> - + <!-- SPDY/3 Connection factory --> <Call name="addConnectionFactory"> <Arg> diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java index 5bbb5e79ab..df05da8157 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootSpdy.java @@ -44,6 +44,7 @@ import org.osgi.framework.BundleContext; * SPDY setup. */ @RunWith(PaxExam.class) +@Ignore public class TestJettyOSGiBootSpdy { private static final String LOG_LEVEL = "WARN"; @@ -56,14 +57,18 @@ public class TestJettyOSGiBootSpdy public Option[] config() { ArrayList<Option> options = new ArrayList<Option>(); - options.addAll(TestJettyOSGiBootWithJsp.configureJettyHomeAndPort("jetty-spdy.xml")); + options.addAll(TestJettyOSGiBootWithJsp.configureJettyHomeAndPort(true,"jetty-spdy.xml")); options.addAll(TestJettyOSGiBootCore.coreJettyDependencies()); options.addAll(spdyJettyDependencies()); options.add(CoreOptions.junitBundles()); options.addAll(TestJettyOSGiBootCore.httpServiceJetty()); options.addAll(Arrays.asList(options(systemProperty("pax.exam.logging").value("none")))); - options.addAll(Arrays.asList(options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(LOG_LEVEL)))); - options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.LEVEL").value(LOG_LEVEL)))); + options.addAll(Arrays.asList(options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG")))); + options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.LEVEL").value("INFO")))); + options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.osgi.LEVEL").value("DEBUG")))); + options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.util.component.LEVEL").value("DEBUG")))); + options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.server.LEVEL").value("DEBUG")))); + options.addAll(Arrays.asList(options(systemProperty("org.eclipse.jetty.xml.LEVEL").value("INFO")))); return options.toArray(new Option[options.size()]); } @@ -78,14 +83,13 @@ public class TestJettyOSGiBootSpdy File checkALPNBoot = new File(alpnBoot); if (!checkALPNBoot.exists()) { throw new IllegalStateException("Unable to find the alpn boot jar here: " + alpnBoot); } - res.add(CoreOptions.vmOptions("-Xbootclasspath/p:" + alpnBoot)); res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-alpn").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-server").versionAsInProject().start()); - res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-client").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-core").versionAsInProject().noStart()); + res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-client").versionAsInProject().start()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-server").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-http-common").versionAsInProject().noStart()); res.add(mavenBundle().groupId("org.eclipse.jetty.spdy").artifactId("spdy-http-server").versionAsInProject().noStart()); @@ -111,6 +115,7 @@ public class TestJettyOSGiBootSpdy @Test public void testSpdyOnHttpService() throws Exception { + TestOSGiUtil.debugBundles(bundleContext); TestOSGiUtil.testHttpServiceGreetings(bundleContext, "https", TestJettyOSGiBootCore.DEFAULT_SSL_PORT); } diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJsp.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJsp.java index 90ff7f194b..0032744e4b 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJsp.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithJsp.java @@ -60,10 +60,9 @@ public class TestJettyOSGiBootWithJsp @Configuration public static Option[] configure() { - ArrayList<Option> options = new ArrayList<Option>(); options.add(CoreOptions.junitBundles()); - options.addAll(configureJettyHomeAndPort("jetty-http.xml")); + options.addAll(configureJettyHomeAndPort(false,"jetty-http.xml")); options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*", "javax.activation.*")); options.add(CoreOptions.systemPackages("com.sun.org.apache.xalan.internal.res","com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal", @@ -78,23 +77,26 @@ public class TestJettyOSGiBootWithJsp return options.toArray(new Option[options.size()]); } - public static List<Option> configureJettyHomeAndPort(String jettySelectorFileName) + public static List<Option> configureJettyHomeAndPort(boolean ssl,String jettySelectorFileName) { File etcFolder = new File("src/test/config/etc"); String etc = "file://" + etcFolder.getAbsolutePath(); List<Option> options = new ArrayList<Option>(); - String xmlConfigs = etc + "/jetty.xml;" - + etc - + "/" - + jettySelectorFileName - + ";" - + etc - + "/jetty-ssl.xml;" - + etc - + "/jetty-https.xml;" - + etc - + "/jetty-deployer.xml;" - + etc + String xmlConfigs = etc + "/jetty.xml"; + if (ssl) + xmlConfigs += ";" + + etc + + "/jetty-ssl.xml;" + + etc + + "/jetty-https.xml;"; + xmlConfigs+= ";" + + etc + + "/" + + jettySelectorFileName + + ";" + + etc + + "/jetty-deployer.xml;" + + etc + "/jetty-testrealm.xml"; options.add(systemProperty(OSGiServerConstants.MANAGED_JETTY_XML_CONFIG_URLS).value(xmlConfigs)); diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml index 33d50c6ef5..c01cb9a766 100644 --- a/jetty-server/pom.xml +++ b/jetty-server/pom.xml @@ -26,7 +26,7 @@ </goals> <configuration> <instructions> - <Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*</Import-Package> + <Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;resolution:=optional,*</Import-Package> <_nouses>true</_nouses> </instructions> </configuration> diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml index f5a3b52841..1bcc086683 100644 --- a/jetty-servlet/pom.xml +++ b/jetty-servlet/pom.xml @@ -26,7 +26,7 @@ </goals> <configuration> <instructions> - <Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;version="9.1";resolution:=optional,*</Import-Package> + <Import-Package>javax.servlet.*;version="[2.6.0,3.2)",org.eclipse.jetty.jmx.*;resolution:=optional,*</Import-Package> <_nouses>true</_nouses> </instructions> </configuration> diff --git a/jetty-spdy/pom.xml b/jetty-spdy/pom.xml index 7e1bdf0db8..a489055418 100644 --- a/jetty-spdy/pom.xml +++ b/jetty-spdy/pom.xml @@ -55,7 +55,7 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.spdy.*;version="9.1"</Export-Package> + <Export-Package>org.eclipse.jetty.spdy.*</Export-Package> <Import-Package>org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> <_nouses>true</_nouses> </instructions> diff --git a/jetty-spdy/spdy-client/pom.xml b/jetty-spdy/spdy-client/pom.xml index 3fe70e3c71..4784dd7d27 100644 --- a/jetty-spdy/spdy-client/pom.xml +++ b/jetty-spdy/spdy-client/pom.xml @@ -28,8 +28,8 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.spdy.client;version="9.1"</Export-Package> - <Import-Package>!org.eclipse.jetty.npn,!org.eclipse.jetty.alpn,org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> + <Export-Package>org.eclipse.jetty.spdy.client</Export-Package> + <Import-Package>!org.eclipse.jetty.npn,org.eclipse.jetty.npn.client;resolution:=optional,!org.eclipse.jetty.alpn,org.eclipse.jetty.alpn.client;resolution:=optional,org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> </instructions> </configuration> </execution> diff --git a/jetty-spdy/spdy-http-client-transport/pom.xml b/jetty-spdy/spdy-http-client-transport/pom.xml index 2562ac2587..028b99817e 100644 --- a/jetty-spdy/spdy-http-client-transport/pom.xml +++ b/jetty-spdy/spdy-http-client-transport/pom.xml @@ -27,7 +27,7 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.spdy.client.http;version="9.1"</Export-Package> + <Export-Package>org.eclipse.jetty.spdy.client.http</Export-Package> <Import-Package>!org.eclipse.jetty.npn,org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> </instructions> </configuration> diff --git a/jetty-spdy/spdy-http-common/pom.xml b/jetty-spdy/spdy-http-common/pom.xml index d9b607888b..0857515bd3 100644 --- a/jetty-spdy/spdy-http-common/pom.xml +++ b/jetty-spdy/spdy-http-common/pom.xml @@ -27,7 +27,7 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.spdy.http;version="9.1"</Export-Package> + <Export-Package>org.eclipse.jetty.spdy.http</Export-Package> <Import-Package>!org.eclipse.jetty.npn,org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> </instructions> </configuration> diff --git a/jetty-spdy/spdy-http-server/pom.xml b/jetty-spdy/spdy-http-server/pom.xml index f5a6373fa0..ffe9f134fe 100644 --- a/jetty-spdy/spdy-http-server/pom.xml +++ b/jetty-spdy/spdy-http-server/pom.xml @@ -56,8 +56,8 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.spdy.server.http;version="9.1", - org.eclipse.jetty.spdy.server.proxy;version="9.1" + <Export-Package>org.eclipse.jetty.spdy.server.http, + org.eclipse.jetty.spdy.server.proxy;version="9.3" </Export-Package> <Import-Package>!org.eclipse.jetty.npn,org.eclipse.jetty.*;version="[9.0,10.0)",* </Import-Package> diff --git a/jetty-spdy/spdy-server/pom.xml b/jetty-spdy/spdy-server/pom.xml index 83e9833350..5f8e53972f 100644 --- a/jetty-spdy/spdy-server/pom.xml +++ b/jetty-spdy/spdy-server/pom.xml @@ -28,7 +28,7 @@ </goals> <configuration> <instructions> - <Export-Package>org.eclipse.jetty.spdy.server;version="9.1"</Export-Package> + <Export-Package>org.eclipse.jetty.spdy.server</Export-Package> <Import-Package>org.eclipse.jetty.alpn;resolution:=optional,org.eclipse.jetty.alpn.server;resolution:=optional, org.eclipse.jetty.npn;resolution:=optional,org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> <_nouses>true</_nouses> </instructions> diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml index 941a7900c4..7a209faeb2 100644 --- a/jetty-websocket/pom.xml +++ b/jetty-websocket/pom.xml @@ -43,7 +43,7 @@ </goals> <configuration> <instructions> - <Export-Package>${bundle-symbolic-name}.*;version="9.1"</Export-Package> + <Export-Package>${bundle-symbolic-name}.*</Export-Package> <Import-Package>javax.servlet.*;version="[3.0,4.0)",org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> <_nouses>true</_nouses> </instructions> diff --git a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java index 3b88bdc893..684216ff17 100644 --- a/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java +++ b/jetty-xml/src/main/java/org/eclipse/jetty/xml/XmlConfiguration.java @@ -346,7 +346,7 @@ public class XmlConfiguration } catch (NoSuchMethodException x) { - throw new IllegalStateException("No suitable constructor on " + oClass, x); + throw new IllegalStateException(String.format("No constructor %s(%s,%s) in %s",oClass,arguments,namedArgMap,_url)); } } _configuration.initializeDefaults(obj); diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml index e45681105e..49ee81234c 100644 --- a/tests/test-webapps/test-jetty-webapp/pom.xml +++ b/tests/test-webapps/test-jetty-webapp/pom.xml @@ -98,7 +98,7 @@ <configuration> <instructions> <Bundle-SymbolicName>org.eclipse.jetty.test-jetty-webapp</Bundle-SymbolicName> - <Import-Package>javax.servlet.jsp.*;version="[2.2.0, 3.0)",javax.servlet.*;version="[2.6,3.2)",org.eclipse.jetty.*;version="9.1",*</Import-Package> + <Import-Package>javax.servlet.jsp.*;version="[2.2.0,3.0)",javax.servlet.*;version="[2.6,3.2)",org.eclipse.jetty.*;version="[9.0,10.0)",*</Import-Package> <Export-Package>!com.acme*</Export-Package> <!-- the test webapp is configured via a jetty xml file in order to add the security handler. --> |