From f47cc6cbc9c9884e643149571b177302531bcb4b Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 13 Oct 2016 22:15:03 +1100 Subject: [PATCH 01/16] fixed racew in unit test --- .../jetty/server/handler/ThreadLimitHandlerTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java index a1436a503f2..add47c71853 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java @@ -238,10 +238,13 @@ public class ThreadLimitHandlerTest latch.countDown(); while(total.get()<10 && System.nanoTime()0 && System.nanoTime() Date: Fri, 14 Oct 2016 08:18:15 +1100 Subject: [PATCH 02/16] Issue #984 Improve module listing Made jul-impl a dependency of logging-jul --- jetty-util/src/main/config/modules/logging-jul.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/jetty-util/src/main/config/modules/logging-jul.mod b/jetty-util/src/main/config/modules/logging-jul.mod index a3d84ff0b25..a11429a9880 100644 --- a/jetty-util/src/main/config/modules/logging-jul.mod +++ b/jetty-util/src/main/config/modules/logging-jul.mod @@ -7,6 +7,7 @@ logging [depends] slf4j-jul +jul-impl [provide] logging From 91f708b9f69f3230e3b64d493eeae106939d4651 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 14 Oct 2016 08:26:41 +1100 Subject: [PATCH 03/16] Issue #984 Improve module listing Use stderrout-logging for jcl-impl --- jetty-util/src/main/config/modules/jcl-impl.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/jetty-util/src/main/config/modules/jcl-impl.mod b/jetty-util/src/main/config/modules/jcl-impl.mod index fbc31353e25..9978485e001 100644 --- a/jetty-util/src/main/config/modules/jcl-impl.mod +++ b/jetty-util/src/main/config/modules/jcl-impl.mod @@ -9,6 +9,7 @@ internal [depends] resources +stderrout-logging [provides] jcl-api From d9c2352966f1a5b79dcd38ab1d5581cd955e9a83 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 14 Oct 2016 10:17:39 +1100 Subject: [PATCH 04/16] Issue #984 Improve module listing improved logging of file copies renamed stderrout-logging to stderrout-capture --- .../java/org/eclipse/jetty/start/BaseBuilder.java | 11 +++++++++-- .../eclipse/jetty/start/builders/StartDirBuilder.java | 3 ++- .../start/fileinits/BaseHomeFileInitializer.java | 6 +++++- .../fileinits/MavenLocalRepoFileInitializer.java | 2 +- .../jetty/start/fileinits/UriFileInitializer.java | 3 ++- jetty-util/src/main/config/modules/jcl-impl.mod | 2 +- jetty-util/src/main/config/modules/logging-jetty.mod | 2 +- .../{stderrout-logging.mod => stderrout-capture.mod} | 3 ++- .../stderrout-capture/stderrout-capture.xml} | 2 +- 9 files changed, 24 insertions(+), 10 deletions(-) rename jetty-util/src/main/config/modules/{stderrout-logging.mod => stderrout-capture.mod} (81%) rename jetty-util/src/main/config/{etc/stderrout-logging.xml => modules/stderrout-capture/stderrout-capture.xml} (94%) diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java index bb399f99b20..cb95adbcd67 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/BaseBuilder.java @@ -163,7 +163,10 @@ public class BaseBuilder if (startArgs.isCreateStartd() && !Files.exists(startd)) { if(FS.ensureDirectoryExists(startd)) + { + StartLog.log("MKDIR",baseHome.toShortForm(startd)); modified.set(true); + } if (Files.exists(startini)) { int ini=0; @@ -273,6 +276,8 @@ public class BaseBuilder { // make the directories in ${jetty.base} that we need boolean modified = FS.ensureDirectoryExists(file.getParent()); + if (modified) + StartLog.log("MKDIR",baseHome.toShortForm(file.getParent())); URI uri = URI.create(arg.uri); @@ -324,8 +329,10 @@ public class BaseBuilder if (isDir) { // Create directory - StartLog.log("MKDIR",baseHome.toShortForm(file)); - return FS.ensureDirectoryExists(file); + boolean mkdir = FS.ensureDirectoryExists(file); + if (mkdir) + StartLog.log("MKDIR",baseHome.toShortForm(file)); + return mkdir; } else { diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java b/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java index 23b239c6566..59e58ca1996 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/builders/StartDirBuilder.java @@ -46,7 +46,8 @@ public class StartDirBuilder implements BaseBuilder.Config { this.baseHome = baseBuilder.getBaseHome(); this.startDir = baseHome.getBasePath("start.d"); - FS.ensureDirectoryExists(startDir); + if (FS.ensureDirectoryExists(startDir)) + StartLog.log("MKDIR",baseHome.toShortForm(startDir)); } @Override diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java index be67fba59a1..39615a4e2fc 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/BaseHomeFileInitializer.java @@ -26,6 +26,7 @@ import java.nio.file.Path; import org.eclipse.jetty.start.BaseHome; import org.eclipse.jetty.start.FS; import org.eclipse.jetty.start.FileInitializer; +import org.eclipse.jetty.start.StartLog; /** * Copy a file found in {@link BaseHome} from a URI of the form @@ -51,7 +52,10 @@ public class BaseHomeFileInitializer implements FileInitializer if (FS.exists(source) && !FS.exists(file)) { - FS.ensureDirectoryExists(file.getParent()); + if (FS.ensureDirectoryExists(file.getParent())) + StartLog.log("MKDIR",_basehome.toShortForm(file.getParent())); + + StartLog.log("COPY ","%s to %s",_basehome.toShortForm(source),_basehome.toShortForm(file)); Files.copy(source,file); return true; } diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java index 81bf831e708..79c22a1c5a5 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/MavenLocalRepoFileInitializer.java @@ -113,7 +113,7 @@ public class MavenLocalRepoFileInitializer extends UriFileInitializer // Grab copy from local repository (download if needed to local // repository) Path localRepoFile = getLocalRepoFile(coords); - StartLog.log("COPY","%s to %s",localRepoFile,baseHome.toShortForm(file)); + StartLog.log("COPY ","%s to %s",localRepoFile,baseHome.toShortForm(file)); Files.copy(localRepoFile,file); } else diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java index 5b1e22f7ef8..8e5814aeed0 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/fileinits/UriFileInitializer.java @@ -66,7 +66,8 @@ public class UriFileInitializer implements FileInitializer { StartLog.log("DOWNLOAD","%s to %s",uri,baseHome.toShortForm(file)); - FS.ensureDirectoryExists(file.getParent()); + if (FS.ensureDirectoryExists(file.getParent())) + StartLog.log("MKDIR",baseHome.toShortForm(file.getParent())); HttpURLConnection http = (HttpURLConnection)uri.toURL().openConnection(); http.setInstanceFollowRedirects(true); diff --git a/jetty-util/src/main/config/modules/jcl-impl.mod b/jetty-util/src/main/config/modules/jcl-impl.mod index 9978485e001..3942e05d116 100644 --- a/jetty-util/src/main/config/modules/jcl-impl.mod +++ b/jetty-util/src/main/config/modules/jcl-impl.mod @@ -9,7 +9,7 @@ internal [depends] resources -stderrout-logging +stderrout-capture [provides] jcl-api diff --git a/jetty-util/src/main/config/modules/logging-jetty.mod b/jetty-util/src/main/config/modules/logging-jetty.mod index 5cb3b055367..44ede6c5862 100644 --- a/jetty-util/src/main/config/modules/logging-jetty.mod +++ b/jetty-util/src/main/config/modules/logging-jetty.mod @@ -7,7 +7,7 @@ logging [depends] resources -stderrout-logging +stderrout-capture [provide] logging diff --git a/jetty-util/src/main/config/modules/stderrout-logging.mod b/jetty-util/src/main/config/modules/stderrout-capture.mod similarity index 81% rename from jetty-util/src/main/config/modules/stderrout-logging.mod rename to jetty-util/src/main/config/modules/stderrout-capture.mod index b1dc2af91e6..380e488ba5a 100644 --- a/jetty-util/src/main/config/modules/stderrout-logging.mod +++ b/jetty-util/src/main/config/modules/stderrout-capture.mod @@ -6,10 +6,11 @@ including output from Jetty's default StdErrLog logging. logging [xml] -etc/stderrout-logging.xml +etc/stderrout-capture.xml [files] logs/ +basehome:modules/stderrout-capture/stderrout-capture.xml|etc/stderrout-capture.xml [lib] resources/ diff --git a/jetty-util/src/main/config/etc/stderrout-logging.xml b/jetty-util/src/main/config/modules/stderrout-capture/stderrout-capture.xml similarity index 94% rename from jetty-util/src/main/config/etc/stderrout-logging.xml rename to jetty-util/src/main/config/modules/stderrout-capture/stderrout-capture.xml index 82c050ac647..5edac2118b1 100644 --- a/jetty-util/src/main/config/etc/stderrout-logging.xml +++ b/jetty-util/src/main/config/modules/stderrout-capture/stderrout-capture.xml @@ -24,7 +24,7 @@ - Redirecting stderr/stdout to + Capturing stderr/stdout to From 68e86e4d4efe9a285eacb7496eac5ea31c130e91 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 14 Oct 2016 10:48:51 +1100 Subject: [PATCH 05/16] Deprecated Modules #1003 Added deprecated.properties file to provide more details of deprecated modules --- .../resources/modules/deprecated.properties | 8 ++++++ .../java/org/eclipse/jetty/start/Modules.java | 27 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 jetty-home/src/main/resources/modules/deprecated.properties diff --git a/jetty-home/src/main/resources/modules/deprecated.properties b/jetty-home/src/main/resources/modules/deprecated.properties new file mode 100644 index 00000000000..d128ab80fc8 --- /dev/null +++ b/jetty-home/src/main/resources/modules/deprecated.properties @@ -0,0 +1,8 @@ +gcloud-memcached-sessions : replaced by 'session-store-cache,session-store-gcloud' +gcloud-session-idmgr : no longer required. +gcloud-sessions : replaced by 'session-store-gcloud' +infinispan : replaced by either 'session-store-infinispan-embedded' or 'session-store-infinispan-remote' +jdbc-sessions : replaced by 'session-store-jdbc' +logging : renamed to 'stderrout-capture' +monitor : no longer supported +nosql : replaced by 'session-store-mongo' \ No newline at end of file diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java index e648719260d..d4a25087363 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/Modules.java @@ -18,6 +18,7 @@ package org.eclipse.jetty.start; +import java.io.FileInputStream; import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; @@ -27,6 +28,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Properties; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; @@ -44,6 +46,7 @@ public class Modules implements Iterable private final Map> _provided = new HashMap<>(); private final BaseHome _baseHome; private final StartArgs _args; + private final Properties _deprecated = new Properties(); public Modules(BaseHome basehome, StartArgs args) { @@ -59,6 +62,19 @@ public class Modules implements Iterable args.setProperty("java.version",java_version,""); } } + + try + { + Path deprecated_path = _baseHome.getPath("modules/deprecated.properties"); + if (deprecated_path!=null && FS.exists(deprecated_path)) + { + _deprecated.load(new FileInputStream(deprecated_path.toFile())); + } + } + catch (IOException e) + { + StartLog.debug(e); + } } public void dump(List tags) @@ -260,7 +276,7 @@ public class Modules implements Iterable { Module module = get(name); if (module==null) - throw new UsageException(UsageException.ERR_UNKNOWN,"Unknown module='%s'",name); + throw new UsageException(UsageException.ERR_UNKNOWN,"Unknown module='%s. List available with --list-modules",name); Set enabled = new HashSet<>(); enable(enabled,module,enabledFrom,false); @@ -354,7 +370,14 @@ public class Modules implements Iterable public Module get(String name) { - return _names.get(name); + Module module = _names.get(name); + if (module==null) + { + String reason = _deprecated.getProperty(name); + if (reason!=null) + StartLog.warn("Deprecated module '%s' is %s",name,reason); + } + return module; } @Override From 937a2d44f7d862ada1a00c35d024c242fae532f1 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 14 Oct 2016 13:57:22 +1100 Subject: [PATCH 06/16] LSB Tags #926 --- jetty-distribution/src/main/resources/bin/jetty.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/jetty-distribution/src/main/resources/bin/jetty.sh b/jetty-distribution/src/main/resources/bin/jetty.sh index d764afcabda..2f6ba41776f 100755 --- a/jetty-distribution/src/main/resources/bin/jetty.sh +++ b/jetty-distribution/src/main/resources/bin/jetty.sh @@ -1,5 +1,16 @@ #!/usr/bin/env bash -# + +# LSB Tags +### BEGIN INIT INFO +# Provides: jetty +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Jetty start script. +# Description: Start Jetty web server. +### END INIT INFO + # Startup script for jetty under *nix systems (it works under NT/cygwin too). ################################################## From 8eb56edc8a3c5ce9d3019143d9a6cf69c7ccc563 Mon Sep 17 00:00:00 2001 From: Denis Bardadym Date: Fri, 14 Oct 2016 06:18:16 +0300 Subject: [PATCH 07/16] Fix typo in DefaultServlet (#988) Fixes #952 Signed-off-by: Denis Bardadym --- .../src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java index 2d41066e7eb..7e0ef42953e 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/DefaultServlet.java @@ -767,7 +767,7 @@ public class DefaultServlet extends HttpServlet implements ResourceFactory if (ifnm!=null && etag!=null) { // Handle special case of exact match OR gzip exact match - if (etag.equals(ifnm) || ifnm.endsWith(ETAG_GZIP_QUOTE) && ifnm.indexOf(',')<0 && etag.equals(removeGzipFromETag(etag))) + if (etag.equals(ifnm) || ifnm.endsWith(ETAG_GZIP_QUOTE) && ifnm.indexOf(',')<0 && etag.equals(removeGzipFromETag(ifnm))) { response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); response.setHeader(HttpHeader.ETAG.asString(),ifnm); From cb74cb8c1fcfd701fe6e9c4a76b6520e400b85a9 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 13 Oct 2016 22:15:03 +1100 Subject: [PATCH 08/16] fixed racew in unit test --- .../jetty/server/handler/ThreadLimitHandlerTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java index a1436a503f2..add47c71853 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/handler/ThreadLimitHandlerTest.java @@ -238,10 +238,13 @@ public class ThreadLimitHandlerTest latch.countDown(); while(total.get()<10 && System.nanoTime()0 && System.nanoTime() Date: Fri, 14 Oct 2016 15:42:12 +1100 Subject: [PATCH 09/16] Issue #984 Improve module listing Fixed cycle in logging from gcloud datastore --- .../main/config/modules/gcloud-datastore.mod | 4 +-- .../eclipse/jetty/start/TopologicalSort.java | 27 +++++++++++++++--- .../usecases/dynamic-loop.0.assert.txt | 2 +- .../test/resources/usecases/loop.assert.txt | 2 +- .../src/main/config/modules/jcl-slf4j.mod | 2 +- .../src/main/config/modules/slf4j-impl.mod | 3 -- .../src/main/config/modules/slf4j-jcl.mod | 2 +- .../eclipse/jetty/util/TopologicalSort.java | 28 +++++++++++++++---- 8 files changed, 52 insertions(+), 18 deletions(-) diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod index 0a8019a762c..fb0a3c937d5 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod @@ -7,8 +7,8 @@ gcloud [depends] gcloud -jcl-api -jcl-impl +jcl-slf4j +slf4j-impl [files] maven://com.google.cloud/google-cloud-datastore/0.3.0|lib/gcloud/google-cloud-datastore-0.3.0.jar diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/TopologicalSort.java b/jetty-start/src/main/java/org/eclipse/jetty/start/TopologicalSort.java index 5253657b188..b9aca77b6cf 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/TopologicalSort.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/TopologicalSort.java @@ -45,7 +45,6 @@ import java.util.TreeSet; * * @param The type to be sorted. It must be able to be added to a {@link HashSet} */ -@SuppressWarnings("Duplicates") public class TopologicalSort { private final Map> _dependencies = new HashMap<>(); @@ -126,8 +125,15 @@ public class TopologicalSort ordered_deps.addAll(dependencies); // recursively visit each dependency - for (T d:ordered_deps) - visit(d,visited,sorted,comparator); + try + { + for (T d:ordered_deps) + visit(d,visited,sorted,comparator); + } + catch (CyclicException e) + { + throw new CyclicException(item,e); + } } // Now that we have visited all our dependencies, they and their @@ -138,7 +144,7 @@ public class TopologicalSort else if (!sorted.contains(item)) // If we have already visited an item, but it has not yet been put in the // sorted list, then we must be in a cycle! - throw new IllegalStateException("cyclic at "+item); + throw new CyclicException(item); } @@ -182,4 +188,17 @@ public class TopologicalSort { return "TopologicalSort "+_dependencies; } + + private static class CyclicException extends IllegalStateException + { + CyclicException(Object item) + { + super("cyclic at "+item); + } + + CyclicException(Object item,CyclicException e) + { + super("cyclic at "+item,e); + } + } } diff --git a/jetty-start/src/test/resources/usecases/dynamic-loop.0.assert.txt b/jetty-start/src/test/resources/usecases/dynamic-loop.0.assert.txt index 3388dbdcfb4..2f38bc2e1b0 100644 --- a/jetty-start/src/test/resources/usecases/dynamic-loop.0.assert.txt +++ b/jetty-start/src/test/resources/usecases/dynamic-loop.0.assert.txt @@ -1,2 +1,2 @@ -EX|IllegalStateException +EX|CyclicException EX|cyclic diff --git a/jetty-start/src/test/resources/usecases/loop.assert.txt b/jetty-start/src/test/resources/usecases/loop.assert.txt index 3388dbdcfb4..2f38bc2e1b0 100644 --- a/jetty-start/src/test/resources/usecases/loop.assert.txt +++ b/jetty-start/src/test/resources/usecases/loop.assert.txt @@ -1,2 +1,2 @@ -EX|IllegalStateException +EX|CyclicException EX|cyclic diff --git a/jetty-util/src/main/config/modules/jcl-slf4j.mod b/jetty-util/src/main/config/modules/jcl-slf4j.mod index 7cabf92dcaa..07de04dd86f 100644 --- a/jetty-util/src/main/config/modules/jcl-slf4j.mod +++ b/jetty-util/src/main/config/modules/jcl-slf4j.mod @@ -11,8 +11,8 @@ internal slf4j-api [provides] -jcl-impl jcl-api +jcl-impl [files] maven://org.slf4j/jcl-over-slf4j/${slf4j.version}|lib/slf4j/jcl-over-slf4j-${slf4j.version}.jar diff --git a/jetty-util/src/main/config/modules/slf4j-impl.mod b/jetty-util/src/main/config/modules/slf4j-impl.mod index 20738e8d909..ef21516ae7d 100644 --- a/jetty-util/src/main/config/modules/slf4j-impl.mod +++ b/jetty-util/src/main/config/modules/slf4j-impl.mod @@ -11,9 +11,6 @@ internal slf4j-api resources -[provide] -slf4j-impl - [files] maven://org.slf4j/slf4j-simple/${slf4j.version}|lib/slf4j/slf4j-simple-${slf4j.version}.jar basehome:modules/slf4j/simplelogger.properties|resources/simplelogger.properties diff --git a/jetty-util/src/main/config/modules/slf4j-jcl.mod b/jetty-util/src/main/config/modules/slf4j-jcl.mod index d1819515258..66866beb313 100644 --- a/jetty-util/src/main/config/modules/slf4j-jcl.mod +++ b/jetty-util/src/main/config/modules/slf4j-jcl.mod @@ -9,7 +9,7 @@ internal [depend] slf4j-api -jcl-api +jcl-impl [provide] slf4j-impl diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java b/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java index 40dd7266797..8db8a217e7f 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/TopologicalSort.java @@ -20,7 +20,6 @@ package org.eclipse.jetty.util; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; @@ -32,7 +31,6 @@ import java.util.TreeSet; import org.eclipse.jetty.util.component.ContainerLifeCycle; import org.eclipse.jetty.util.component.Dumpable; -import org.eclipse.jetty.util.component.DumpableCollection; /** @@ -131,8 +129,15 @@ public class TopologicalSort implements Dumpable ordered_deps.addAll(dependencies); // recursively visit each dependency - for (T d:ordered_deps) - visit(d,visited,sorted,comparator); + try + { + for (T d:ordered_deps) + visit(d,visited,sorted,comparator); + } + catch (CyclicException e) + { + throw new CyclicException(item,e); + } } // Now that we have visited all our dependencies, they and their @@ -143,7 +148,7 @@ public class TopologicalSort implements Dumpable else if (!sorted.contains(item)) // If we have already visited an item, but it has not yet been put in the // sorted list, then we must be in a cycle! - throw new IllegalStateException("cyclic at "+item); + throw new CyclicException(item); } @@ -201,4 +206,17 @@ public class TopologicalSort implements Dumpable out.append(String.format("TopologicalSort@%x%n",hashCode())); ContainerLifeCycle.dump(out, indent,_dependencies.entrySet()); } + + private static class CyclicException extends IllegalStateException + { + CyclicException(Object item) + { + super("cyclic at "+item); + } + + CyclicException(Object item,CyclicException e) + { + super("cyclic at "+item,e); + } + } } From 18693074debc555274744fd48d1c5e6b88de751c Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Fri, 14 Oct 2016 15:51:32 +1100 Subject: [PATCH 10/16] Issue #1007 --- .../main/config/modules/gcloud-datastore.mod | 65 ++++++++++--------- .../src/main/config/modules/gcloud.mod | 2 +- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod index fb0a3c937d5..7c7d26edecb 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud-datastore.mod @@ -11,8 +11,8 @@ jcl-slf4j slf4j-impl [files] -maven://com.google.cloud/google-cloud-datastore/0.3.0|lib/gcloud/google-cloud-datastore-0.3.0.jar -maven://com.google.cloud/google-cloud-core/0.3.0|lib/gcloud/google-cloud-core-0.3.0.jar +maven://com.google.cloud/google-cloud-datastore/0.4.0|lib/gcloud/google-cloud-datastore-0.4.0.jar +maven://com.google.cloud/google-cloud-core/0.4.0|lib/gcloud/google-cloud-core-0.4.0.jar maven://com.google.auth/google-auth-library-credentials/0.3.1|lib/gcloud/google-auth-library-credentials-0.3.1.jar maven://com.google.auth/google-auth-library-oauth2-http/0.3.1|lib/gcloud/google-auth-library-oauth2-http-0.3.1.jar maven://com.google.http-client/google-http-client-jackson2/1.19.0|lib/gcloud/google-http-client-jackson2-1.19.0.jar @@ -35,38 +35,41 @@ maven://com.google.http-client/google-http-client-appengine/1.21.0|lib/gcloud/go maven://com.google.http-client/google-http-client-jackson/1.21.0|lib/gcloud/google-http-client-jackson-1.21.0.jar maven://org.codehaus.jackson/jackson-core-asl/1.9.11|lib/gcloud/jackson-core-asl-1.9.11.jar maven://joda-time/joda-time/2.9.2|lib/gcloud/joda-time-2.9.2.jar -maven://com.google.protobuf/protobuf-java/3.0.0-beta-3|lib/gcloud/protobuf-java-3.0.0-beta-3.jar -maven://com.google.api/gax/0.0.16|lib/gcloud/gax-0.0.16.jar -maven://io.grpc/grpc-all/0.15.0|lib/gcloud/grpc-all-0.15.0.jar -maven://io.grpc/grpc-auth/0.15.0|lib/gcloud/grpc-auth-0.15.0.jar -maven://io.grpc/grpc-netty/0.15.0|lib/gcloud/grpc-netty-0.15.0.jar -maven://io.netty/netty-codec-http2/4.1.1.Final|lib/gcloud/netty-codec-http2-4.1.1.jar -maven://io.netty/netty-codec-http/4.1.1.Final|lib/gcloud/netty-codec-http-4.1.1.Final.jar -maven://io.netty/netty-codec/4.1.1.Final|lib/gcloud/netty-codec-4.1.1.Final.jar -maven://io.netty/netty-handler/4.1.1.Final|lib/gcloud/netty-handler-4.1.1.Final.jar -maven://io.netty/netty-buffer/4.1.1.Final|lib/gcloud/netty-buffer-4.1.1.Final.jar -maven://io.netty/netty-common/4.1.1.Final|lib/gcloud/netty-common-4.1.1.Final.jar -maven://io.netty/netty-transport/4.1.1.Final|lib/gcloud/netty-transport-4.1.1.Final.jar -maven://io.netty/netty-resolver/4.1.1.Final|lib/gcloud/netty-resolver-4.1.1.Final.jar -maven://io.grpc/grpc-okhttp/0.15.0|lib/gcloud/grpc-okhttp-0.15.0.jar +maven://org.json/json/20151123|lib/gcloud/json-20151123.jar +maven://com.google.protobuf/protobuf-java/3.0.0|lib/gcloud/protobuf-java-3.0.0.jar +maven://com.google.api/gax/0.0.18|lib/gcloud/gax-0.0.18.jar +maven://com.google.auto.value/auto-value/1.1|lib/gcloud/auto-value-1.1.jar +maven://io.grpc/grpc-all/1.0.1|lib/gcloud/grpc-all-1.0.1.jar +maven://io.grpc/grpc-auth/1.0.1|lib/gcloud/grpc-auth-1.0.1.jar +maven://io.grpc/grpc-context/1.0.1|lib/gcloud/grpc-context-1.0.1.jar +maven://io.grpc/grpc-protobuf/1.0.1|lib/gcloud/grpc-protobuf-1.0.1.jar +maven://com.google.protobuf/protobuf-java-util/3.0.0|lib/gcloud/protobuf-java-util-3.0.0.jar +maven://com.google.code.gson/gson/2.3|lib/gcloud/gson-2.3.jar +maven://io.grpc/grpc-netty/1.0.1|lib/gcloud/grpc-netty-1.0.1.jar +maven://io.netty/netty-codec-http2/4.1.3.Final|lib/gcloud/netty-codec-http2-4.1.3.jar +maven://io.netty/netty-codec-http/4.1.3.Final|lib/gcloud/netty-codec-http-4.1.3.Final.jar +maven://io.netty/netty-codec/4.1.3.Final|lib/gcloud/netty-codec-4.1.3.Final.jar +maven://io.netty/netty-handler/4.1.3.Final|lib/gcloud/netty-handler-4.1.3.Final.jar +maven://io.netty/netty-buffer/4.1.3.Final|lib/gcloud/netty-buffer-4.1.3.Final.jar +maven://io.netty/netty-common/4.1.3.Final|lib/gcloud/netty-common-4.1.3.Final.jar +maven://io.netty/netty-transport/4.1.3.Final|lib/gcloud/netty-transport-4.1.3.Final.jar +maven://io.netty/netty-resolver/4.1.3.Final|lib/gcloud/netty-resolver-4.1.3.Final.jar +maven://io.grpc/grpc-stub/1.0.1|lib/gcloud/grpc-stub-1.0.1.jar +maven://io.grpc/grpc-protobuf-nano/1.0.1|lib/gcloud/grpc-protobuf-nano-1.0.1.jar +maven://com.google.protobuf.nano/protobuf-javanano/3.0.0-alpha-5|lib/gcloud/protobuf-javanano/3.0.0-alpha-5.jar +maven://io.grpc/grpc-core/1.0.1|lib/gcloud/grpc-core-1.0.1.jar +maven://io.grpc/grpc-okhttp/1.0.1|lib/gcloud/grpc-okhttp-1.0.1.jar maven://com.squareup.okio/okio/1.6.0|lib/gcloud/okio-1.6.0.jar maven://com.squareup.okhttp/okhttp/2.5.0|lib/gcloud/okhttp-2.5.0.jar -maven://io.grpc/grpc-protobuf-nano/0.15.0|lib/gcloud/grpc-protobuf-nano-0.15.0.jar -maven://com.google.protobuf.nano/protobuf-javanano/3.0.0-alpha-5|lib/gcloud/protobuf-javanano-3.0.0-alpha-5.jar -maven://io.grpc/grpc-stub/0.15.0|lib/gcloud/grpc-stub-0.15.0.jar -maven://io.grpc/grpc-protobuf/0.15.0|lib/gcloud/grpc-protobuf-0.15.0.jar -maven://com.google.protobuf/protobuf-java-util/3.0.0-beta-3|lib/gcloud/protobuf-java-util-3.0.0-beta-3.jar -maven://com.google.code.gson/gson/2.3|lib/gcloud/gson-2.3.jar -maven://io.grpc/grpc-protobuf-lite/0.15.0|lib/gcloud/grpc-protobuf-lite-0.15.0.jar -maven://io.grpc/grpc-core/0.15.0|lib/gcloud/grpc-core-0.15.0.jar -maven://com.google.auto.value/auto-value/1.1|lib/gcloud/auto-value-1.1.jar +maven://io.grpc/grpc-protobuf-lite/1.0.1|lib/gcloud/grpc-protobuf-lite-1.0.1.jar +maven://com.google.protobuf/protobuf-lite/3.0.1|lib/gcloud/protobuf-lite-3.0.1.jar maven://com.google.inject/guice/4.0|lib/gcloud/guice-4.0.jar maven://javax.inject/javax.inject/1|lib/gcloud/javax.inject-1.jar maven://aopalliance/aopalliance/1.0|lib/gcloud/aopalliance-1.0.jar -maven://com.google.api.grpc/grpc-google-common-protos/0.0.7|lib/gcloud/grpc-google-common-protos-0.0.7.jar -maven://org.json/json/20151123|lib/gcloud/json-20151123.jar -maven://com.google.cloud.datastore/datastore-v1-protos/1.0.1|lib/gcloud/datastore-v1-protos-1.0.1-beta.jar -maven://com.google.cloud.datastore/datastore-v1-proto-client/1.1.0|lib/gcloud/datastore-v1-proto-client-1.1.0.jar +maven://com.google.api.grpc/grpc-google-common-protos/0.1.0|lib/gcloud/grpc-google-common-protos-0.1.0.jar +maven://com.google.api.grpc/grpc-google-iam-v1/0.1.0|lib/gcloud/grpc-google-iam-v1-0.1.0.jar +maven://com.google.cloud.datastore/datastore-v1-protos/1.2.0|lib/gcloud/datastore-v1-protos-1.2.0.jar +maven://com.google.cloud.datastore/datastore-v1-proto-client/1.2.0|lib/gcloud/datastore-v1-proto-client-1.2.0.jar maven://com.google.http-client/google-http-client-protobuf/1.20.0|lib/gcloud/google-http-client-protobuf-1.20.0.jar -maven://com.google.api-client/google-api-client/1.20.0|lib/gcloud/google-api-client-1.20.0.jar -maven://com.google.guava/guava-jdk5/13.0|lib/gcloud/guava-jdk5-13.0.jar +maven://com.google.api-client/google-api-client/1.20.0|lib/gcloud/google-api-client/1.20.0 + diff --git a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod index 305d996804b..71ab903803e 100644 --- a/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod +++ b/jetty-gcloud/jetty-gcloud-session-manager/src/main/config/modules/gcloud.mod @@ -15,4 +15,4 @@ http://www.apache.org/licenses/LICENSE-2.0.html [ini-template] ## Hide the gcloud libraries from deployed webapps -jetty.webapp.addServerClasses,=file:${jetty.base}/lib/gcloud/ +jetty.webapp.addServerClasses+=,file:${jetty.base}/lib/gcloud/ From 7a2548ea72efef1c144d603cab609e337e6b128b Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 14 Oct 2016 10:33:33 -0700 Subject: [PATCH 11/16] Fixing script --- scripts/release-jetty.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release-jetty.sh b/scripts/release-jetty.sh index 634481a59cf..c2002ba3dec 100755 --- a/scripts/release-jetty.sh +++ b/scripts/release-jetty.sh @@ -45,7 +45,7 @@ function gitFindRemoteByUrl() { return 0 } -GIT_REMOTE_URL="git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project.git" +GIT_REMOTE_URL="github.com:eclipse/jetty.project.git" GIT_REMOTE_ID=$(gitFindRemoteByUrl "$GIT_REMOTE_URL") GIT_BRANCH_ID=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match) From 6c3c24e7dd7a22ee7e029e85eeda6a2626d7e89b Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 14 Oct 2016 10:34:18 -0700 Subject: [PATCH 12/16] Updating jetty-version-maven-plugin declaration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db0a604c822..5c1dc8c4b48 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.eclipse.jetty.toolchain jetty-version-maven-plugin - 2.1 + 2.2 org.apache.maven.plugins From 02309d35105c89ec9f372715d86445fb72dbf628 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 14 Oct 2016 15:55:18 +1100 Subject: [PATCH 13/16] Issue #984 Improve module listing Updated CSV operator --- jetty-webapp/src/main/config/modules/webapp.mod | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jetty-webapp/src/main/config/modules/webapp.mod b/jetty-webapp/src/main/config/modules/webapp.mod index 83e2d839d1d..22d5ed8d5b2 100644 --- a/jetty-webapp/src/main/config/modules/webapp.mod +++ b/jetty-webapp/src/main/config/modules/webapp.mod @@ -24,5 +24,7 @@ lib/jetty-webapp-${jetty.version}.jar ## + a directory of jars,resource or classes e.g. 'file:${jetty.base}/resources' ## + A pattern preceeded with a '-' is an exclusion, all other patterns are inclusions ## -jetty.webapp.addSystemClasses,= -jetty.webapp.addServerClasses,= +## The +=, operator appends to a CSV list with a comma as needed. +## +#jetty.webapp.addSystemClasses+=,org.example. +#jetty.webapp.addServerClasses+=,org.example. From 6adfc324ad9acb4839592eaca872e16607d99d96 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 17 Oct 2016 11:43:58 +1100 Subject: [PATCH 14/16] remove blockfor #1009 --- jetty-server/src/main/config/etc/jetty-threadlimit.xml | 1 - jetty-server/src/main/config/modules/threadlimit.mod | 3 --- 2 files changed, 4 deletions(-) diff --git a/jetty-server/src/main/config/etc/jetty-threadlimit.xml b/jetty-server/src/main/config/etc/jetty-threadlimit.xml index 20faf163287..11376e0478e 100644 --- a/jetty-server/src/main/config/etc/jetty-threadlimit.xml +++ b/jetty-server/src/main/config/etc/jetty-threadlimit.xml @@ -11,7 +11,6 @@ - diff --git a/jetty-server/src/main/config/modules/threadlimit.mod b/jetty-server/src/main/config/modules/threadlimit.mod index 1a2615bd9b9..da07292700e 100644 --- a/jetty-server/src/main/config/modules/threadlimit.mod +++ b/jetty-server/src/main/config/modules/threadlimit.mod @@ -17,9 +17,6 @@ etc/jetty-threadlimit.xml ## Enabled by default? #jetty.threadlimit.enabled=true -## MS to block for waiting for available thread -#jetty.threadlimit.blockForMs=0 - ## Thread limit per remote IP #jetty.threadlimit.threadLimit=10 From 8f522dcb2cdae3bbbd547a6180c3d6904565fc0a Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 17 Oct 2016 12:23:19 +1100 Subject: [PATCH 15/16] fixed bad merge --- .../java/org/eclipse/jetty/http/CompressedContentFormat.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java b/jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java index 9fe30ff48b9..ae05a59b751 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/CompressedContentFormat.java @@ -61,9 +61,8 @@ public class CompressedContentFormat return true; int dashdash = tag.indexOf("--"); - if (dashdash>0) - return tag.charAt(0)== '"' && etag.charAt(0)=='"' && etag.regionMatches(1,tag,1,dashdash-2); + return etag.regionMatches(0,tag,0,dashdash-2); return false; } } From f305bf8a2d7f5ddf32f840714954f8bae9963178 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Mon, 17 Oct 2016 15:34:08 +0200 Subject: [PATCH 16/16] Made the test more robust. --- .../eclipse/jetty/http/client/ConnectionStatisticsTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java index 37597b66a30..fd718357558 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/ConnectionStatisticsTest.java @@ -83,6 +83,9 @@ public class ConnectionStatisticsTest extends AbstractTest // Close all connections. stop(); + // Give some time to process the stop event. + Thread.sleep(1000); + Assert.assertThat(serverStats.getConnectionsMax(), Matchers.greaterThan(0L)); Assert.assertThat(serverStats.getReceivedBytes(), Matchers.greaterThan(contentLength)); Assert.assertThat(serverStats.getSentBytes(), Matchers.greaterThan(contentLength));