From d808094e8213e6ed7ca748460195eedc62d566e3 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 19 Sep 2017 14:32:34 +1000 Subject: [PATCH 1/3] Issue #1829 --- .../annotations/AnnotationConfiguration.java | 19 +++++++++++++++++++ .../eclipse/jetty/osgi/test/TestOSGiUtil.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java index 80935a4693f..4c4aef88441 100644 --- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java +++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java @@ -25,9 +25,11 @@ import java.util.Set; import javax.servlet.ServletContainerInitializer; + import org.eclipse.jetty.annotations.AnnotationParser.Handler; import org.eclipse.jetty.osgi.boot.OSGiWebInfConfiguration; import org.eclipse.jetty.osgi.boot.OSGiWebappConstants; +import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.resource.Resource; @@ -184,6 +186,23 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot parseBundle(context,parser,webbundle,webbundle); } + + + + /** + * @see org.eclipse.jetty.annotations.AnnotationConfiguration#parseWebInfClasses(org.eclipse.jetty.webapp.WebAppContext, org.eclipse.jetty.annotations.AnnotationParser) + */ + @Override + public void parseWebInfClasses(WebAppContext context, org.eclipse.jetty.annotations.AnnotationParser parser) + throws Exception + { + Bundle webbundle = (Bundle) context.getAttribute(OSGiWebappConstants.JETTY_OSGI_BUNDLE); + String bundleClasspath = (String)webbundle.getHeaders().get(Constants.BUNDLE_CLASSPATH); + //only scan WEB-INF/classes if we didn't already scan it with parseWebBundle + if (StringUtil.isBlank(bundleClasspath) || !bundleClasspath.contains("WEB-INF/classes")) + super.parseWebInfClasses(context, parser); + } + /** * Scan a bundle required by the webbundle for servlet annotations * @param context The webapp context diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java index bd64e9e6e40..c78488e03f6 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java @@ -128,7 +128,7 @@ public class TestOSGiUtil for (Bundle b : bundleContext.getBundles()) { bundlesIndexedBySymbolicName.put(b.getSymbolicName(), b); - System.err.println(" " + b.getSymbolicName() + " " + b.getLocation() + " " + b.getVersion()+ " " + b.getState()); + System.err.println(" " + b.getBundleId()+" "+b.getSymbolicName() + " " + b.getLocation() + " " + b.getVersion()+ " " + b.getState()); } } From d3b14b97fbcadd18c9887b8ff26f197eb83938ae Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Tue, 19 Sep 2017 14:38:14 +1000 Subject: [PATCH 2/3] Issue #1760 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d8fc754385b..7e5c1ac9650 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 1.6.6 1.2 1.1.3.v20160715 - 8.5.9.1 + 8.5.20 undefined From d9ecd5e6bcc992f629cb65ac9e4507746cf210d7 Mon Sep 17 00:00:00 2001 From: Jan Bartel Date: Wed, 20 Sep 2017 13:31:49 +1000 Subject: [PATCH 3/3] Issue #1818 --- .../etc/sessions/infinispan/default.xml | 1 + .../session-store-infinispan-embedded-910.mod | 33 +++++++++++++++++ .../session-store-infinispan-embedded.mod | 3 ++ .../infinispan-embedded.xml | 5 +++ .../session-store-infinispan-remote-910.mod | 35 +++++++++++++++++++ .../test-infinispan-sessions/pom.xml | 14 +++++++- .../session/ClusteredLastAccessTimeTest.java | 3 -- .../ClusteredSessionScavengingTest.java | 3 -- 8 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod create mode 100644 jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded/infinispan-embedded.xml create mode 100644 jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod diff --git a/jetty-infinispan/src/main/config/etc/sessions/infinispan/default.xml b/jetty-infinispan/src/main/config/etc/sessions/infinispan/default.xml index cdd7870b8e0..efc565e2fad 100644 --- a/jetty-infinispan/src/main/config/etc/sessions/infinispan/default.xml +++ b/jetty-infinispan/src/main/config/etc/sessions/infinispan/default.xml @@ -9,6 +9,7 @@ + /etc/infinispan-embedded.xml diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod new file mode 100644 index 00000000000..96b6acb23e1 --- /dev/null +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded-910.mod @@ -0,0 +1,33 @@ +[description] +Enables session data store in a local Infinispan cache + +[tags] +session + +[provides] +session-store +session-store-infinispan-embedded + +[depend] +sessions + +[files] +maven://org.infinispan/infinispan-embedded/9.1.0.Final|lib/infinispan/infinispan-embedded-9.1.0.Final.jar +basehome:modules/session-store-infinispan-embedded/infinispan-embedded.xml|etc/infinispan-embedded.xml + + +[xml] +etc/sessions/infinispan/default.xml + +[lib] +lib/jetty-infinispan-${jetty.version}.jar +lib/infinispan/*.jar + +[license] +Infinispan is an open source project hosted on Github and released under the Apache 2.0 license. +http://infinispan.org/ +http://www.apache.org/licenses/LICENSE-2.0.html + +[ini-template] +#jetty.session.gracePeriod.seconds=3600 +#jetty.session.savePeriod.seconds=0 diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod index 4addf799a61..1110aaadbd3 100644 --- a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded.mod @@ -6,12 +6,15 @@ session [provides] session-store +session-store-infnispan-embedded [depend] sessions [files] maven://org.infinispan/infinispan-embedded/7.1.1.Final|lib/infinispan/infinispan-embedded-7.1.1.Final.jar +basehome:modules/session-store-infinispan-embedded/infinispan-embedded.xml|etc/infinispan-embedded.xml + [xml] etc/sessions/infinispan/default.xml diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded/infinispan-embedded.xml b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded/infinispan-embedded.xml new file mode 100644 index 00000000000..5adc356b1f6 --- /dev/null +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-embedded/infinispan-embedded.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod new file mode 100644 index 00000000000..36493531d38 --- /dev/null +++ b/jetty-infinispan/src/main/config/modules/session-store-infinispan-remote-910.mod @@ -0,0 +1,35 @@ +[description] +Enables session data store in a remote Infinispan cache + +[tags] +session + +[provides] +session-store +session-store-infinispan-remote + +[depend] +sessions + +[files] +maven://org.infinispan/infinispan-remote/9.1.0.Final|lib/infinispan/infinispan-remote-9.1.0.Final.jar +basehome:modules/session-store-infinispan-remote/ + +[xml] +etc/sessions/infinispan/remote.xml + +[lib] +lib/jetty-infinispan-${jetty.version}.jar +lib/infinispan/*.jar + +[license] +Infinispan is an open source project hosted on Github and released under the Apache 2.0 license. +http://infinispan.org/ +http://www.apache.org/licenses/LICENSE-2.0.html + + +[ini-template] +#jetty.session.infinispan.remoteCacheName=sessions +#jetty.session.infinispan.idleTimeout.seconds=0 +#jetty.session.gracePeriod.seconds=3600 +#jetty.session.savePeriod.seconds=0 diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml index f13a308a84a..f4f5440330d 100644 --- a/tests/test-sessions/test-infinispan-sessions/pom.xml +++ b/tests/test-sessions/test-infinispan-sessions/pom.xml @@ -84,6 +84,12 @@ org.eclipse.jetty jetty-infinispan ${project.version} + + + org.infinispan + infinispan-core + + org.eclipse.jetty @@ -96,10 +102,16 @@ jetty-test-helper test + + org.infinispan + infinispan-core + 9.1.0.Final + test + org.infinispan infinispan-client-hotrod - 7.1.1.Final + 9.1.0.Final test diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredLastAccessTimeTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredLastAccessTimeTest.java index 8523a38dfdc..14fd6b2e0d9 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredLastAccessTimeTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredLastAccessTimeTest.java @@ -21,7 +21,6 @@ package org.eclipse.jetty.server.session; import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory; import org.eclipse.jetty.toolchain.test.JDK; import org.junit.AfterClass; -import org.junit.Assume; import org.junit.BeforeClass; public class ClusteredLastAccessTimeTest extends AbstractClusteredLastAccessTimeTest @@ -31,8 +30,6 @@ public class ClusteredLastAccessTimeTest extends AbstractClusteredLastAccessTime @BeforeClass public static void setup () throws Exception { - Assume.assumeFalse(JDK.IS_9); - __testSupport = new InfinispanTestSupport(); __testSupport.setUseFileStore(true); __testSupport.setup(); diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java index a148b22d6a0..538d6c15491 100644 --- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java +++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java @@ -22,7 +22,6 @@ package org.eclipse.jetty.server.session; import org.eclipse.jetty.session.infinispan.InfinispanSessionDataStoreFactory; import org.eclipse.jetty.toolchain.test.JDK; import org.junit.AfterClass; -import org.junit.Assume; import org.junit.BeforeClass; /** @@ -37,8 +36,6 @@ public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScav @BeforeClass public static void setup () throws Exception { - Assume.assumeFalse(JDK.IS_9); - __testSupport = new InfinispanTestSupport(); __testSupport.setUseFileStore(true); __testSupport.setup();