From fda9cd0f5db6f52734100d198f5bd81ab25df975 Mon Sep 17 00:00:00 2001 From: Grzegorz Grzybek Date: Wed, 21 Jun 2023 16:04:26 +0200 Subject: [PATCH] [#1802] Switch pax-web-itest-osgi from javax to jakarta --- pax-web-api/pom.xml | 19 +-- pax-web-itest/pax-web-itest-common/pom.xml | 36 +++-- .../web/itest/AbstractControlledTestBase.java | 135 ++++++++++-------- pax-web-itest/pax-web-itest-osgi/pom.xml | 8 +- pax-web-itest/pax-web-itest-osgi/readme.adoc | 2 +- .../osgi/ClassPathUtilIntegrationTest.java | 2 +- .../osgi/PaxWebRuntimeIntegrationTest.java | 10 +- .../itest/osgi/PaxWebSpiIntegrationTest.java | 4 +- .../osgi/support/MockServerController.java | 2 +- .../web/itest/utils/web/Bundle2Activator.java | 2 +- .../utils/web/FilterBundleActivator.java | 2 +- .../utils/web/ServletBundleActivator.java | 2 +- pax-web-spi/pom.xml | 8 +- pax-web-tomcat-common/pom.xml | 2 +- .../jsf-primefaces-embedded-fragment/pom.xml | 4 +- .../jsf-primefaces-embedded/pom.xml | 28 +--- samples/samples-war/war-simplest-osgi/pom.xml | 6 +- .../web/samples/war/osgi/SimplestServlet.java | 8 +- 18 files changed, 141 insertions(+), 139 deletions(-) diff --git a/pax-web-api/pom.xml b/pax-web-api/pom.xml index eec6aab636..9ee4658551 100644 --- a/pax-web-api/pom.xml +++ b/pax-web-api/pom.xml @@ -136,14 +136,6 @@ org.osgi.framework;version="[1.10,2)", org.osgi.framework.wiring;version="[1.2,2)", - - org.osgi.service.servlet.context;version="2.0.0", - org.osgi.service.servlet.runtime;version="2.0.0", - org.osgi.service.servlet.runtime.dto;version="2.0.0", - org.osgi.service.servlet.whiteboard;version="2.0.0", - org.osgi.service.servlet.whiteboard.annotations;version="2.0.0", - org.osgi.service.servlet.whiteboard.propertytypes;version="2.0.0", - org.slf4j;version="[2,3)" @@ -155,6 +147,17 @@ org.ops4j.pax.web.utils;version="${pax-web.osgi.version}", + + + org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}", + + + org.osgi.service.servlet.context;version="2.0.0", + org.osgi.service.servlet.runtime;version="2.0.0", + org.osgi.service.servlet.runtime.dto;version="2.0.0", + org.osgi.service.servlet.whiteboard;version="2.0.0", + org.osgi.service.servlet.whiteboard.annotations;version="2.0.0", + org.osgi.service.servlet.whiteboard.propertytypes;version="2.0.0", {maven-resources}, diff --git a/pax-web-itest/pax-web-itest-common/pom.xml b/pax-web-itest/pax-web-itest-common/pom.xml index 07cc2146a3..b3f9a664c9 100644 --- a/pax-web-itest/pax-web-itest-common/pom.xml +++ b/pax-web-itest/pax-web-itest-common/pom.xml @@ -54,27 +54,28 @@ - - javax.servlet;version="[3.1,5)", - javax.servlet.annotation;version="[3.1,5)", - javax.servlet.http;version="[3.1,5)", - javax.websocket;resolution:=optional, - javax.websocket.server;resolution:=optional, - - - org.osgi.framework;version="[1.8,2)", + + jakarta.servlet;version="[6,7)", + jakarta.servlet.annotation;version="[6,7)", + jakarta.servlet.http;version="[6,7)", + + jakarta.websocket;version="[2.1,3)", + jakarta.websocket.server;version="[2.1,3)", + + + org.osgi.framework;version="[1.10,2)", org.osgi.framework.wiring;version="[1.2,2)", org.osgi.util.tracker;version="[1.5,2)", org.osgi.service.cm;resolution:=optional, - org.osgi.service.http;version="[1.2,2)", - org.osgi.service.http.context;version="[1.1,2)", - org.osgi.service.http.runtime.dto;version="[1.1,2)", - org.osgi.service.http.runtime;version="[1.1,2)", + org.osgi.service.servlet.context;version="[2,3)", + org.osgi.service.servlet.runtime.dto;version="[2,3)", + org.osgi.service.servlet.runtime;version="[2,3)", org.ops4j.pax.web.service;version="${pax-web.osgi.version}", + org.ops4j.pax.web.service.http;version="${pax-web.osgi.version}", org.ops4j.pax.web.service.spi.model.events;version="${pax-web.osgi.version}", @@ -87,7 +88,7 @@ org.ops4j.pax.web.itest.utils.web, - org.slf4j;version="[1.7,2)", + org.slf4j;version="[2,3)", org.ops4j.pax.logging;version="[2.0,3)", @@ -147,6 +148,13 @@ jakarta.servlet-api + + + + org.osgi + osgi.core + + diff --git a/pax-web-itest/pax-web-itest-common/src/main/java/org/ops4j/pax/web/itest/AbstractControlledTestBase.java b/pax-web-itest/pax-web-itest-common/src/main/java/org/ops4j/pax/web/itest/AbstractControlledTestBase.java index 00ed885d29..44d2291724 100644 --- a/pax-web-itest/pax-web-itest-common/src/main/java/org/ops4j/pax/web/itest/AbstractControlledTestBase.java +++ b/pax-web-itest/pax-web-itest-common/src/main/java/org/ops4j/pax/web/itest/AbstractControlledTestBase.java @@ -42,6 +42,7 @@ import org.ops4j.pax.web.itest.utils.WaitCondition; import org.ops4j.pax.web.service.PaxWebConstants; import org.ops4j.pax.web.service.WebContainer; +import org.ops4j.pax.web.service.http.HttpService; import org.ops4j.pax.web.service.spi.model.events.FilterEventData; import org.ops4j.pax.web.service.spi.model.events.ServerEvent; import org.ops4j.pax.web.service.spi.model.events.ServerListener; @@ -56,7 +57,6 @@ import org.osgi.framework.BundleException; import org.osgi.framework.Constants; import org.osgi.framework.ServiceRegistration; -import org.osgi.service.http.HttpService; import org.osgi.util.tracker.ServiceTracker; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -205,10 +205,12 @@ protected Option[] paxWebCore() { return new Option[] { mavenBundle("jakarta.annotation", "jakarta.annotation-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-annotation13") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-annotation13") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.servlet", "jakarta.servlet-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), +// mavenBundle("org.osgi", "org.osgi.service.servlet") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).start(), mavenBundle("org.ops4j.pax.web", "pax-web-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).start(), mavenBundle("org.ops4j.pax.web", "pax-web-spi") @@ -218,9 +220,9 @@ protected Option[] paxWebCore() { /** * Installation of Pax Web Runtime - the first Pax Web bundle with an activator and implementation - * of {@link org.osgi.service.http.HttpService} (though it needs an instance of + * of {@link HttpService} (though it needs an instance of * {@link org.ops4j.pax.web.service.spi.ServerControllerFactory} to actually register - * {@link org.osgi.service.http.HttpService}. + * {@link HttpService}. * @return */ protected Option[] paxWebRuntime() { @@ -266,8 +268,8 @@ protected Option[] paxWebJsp() { return new Option[] { mavenBundle("jakarta.el", "jakarta.el-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("org.ops4j.pax.web", "pax-web-tomcat-common") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.eclipse.jdt", "ecj") @@ -281,8 +283,8 @@ protected Option[] paxWebJspForTomcatBundle() { return new Option[] { mavenBundle("jakarta.el", "jakarta.el-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("org.eclipse.jdt", "ecj") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.ops4j.pax.web", "pax-web-jsp") @@ -312,12 +314,12 @@ protected Option[] paxWebJetty() { .artifactId("jetty-server").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-xml").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty") - .artifactId("jetty-servlet").versionAsInProject(), + mavenBundle().groupId("org.eclipse.jetty.ee10") + .artifactId("jetty-ee10-servlet").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-security").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty") - .artifactId("jetty-jaas").versionAsInProject() +// mavenBundle().groupId("org.eclipse.jetty") +// .artifactId("jetty-jaas").versionAsInProject() }; } @@ -328,20 +330,21 @@ protected Option[] paxWebJetty() { protected Option[] paxWebJettyHttp2() { Option[] common = combine(paxWebJetty(), mavenBundle().groupId("org.eclipse.jetty.http2") - .artifactId("http2-hpack").versionAsInProject(), + .artifactId("jetty-http2-hpack").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty.http2") - .artifactId("http2-common").versionAsInProject(), + .artifactId("jetty-http2-common").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty.http2") - .artifactId("http2-server").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty") - .artifactId("jetty-alpn-server").versionAsInProject() - ); - return combine(common, - mavenBundle().groupId("org.eclipse.jetty.alpn") - .artifactId("alpn-api").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty") - .artifactId("jetty-alpn-java-server").versionAsInProject() + .artifactId("jetty-http2-server").versionAsInProject() +// mavenBundle().groupId("org.eclipse.jetty") +// .artifactId("jetty-alpn-server").versionAsInProject() ); +// return combine(common, +// mavenBundle().groupId("org.eclipse.jetty.alpn") +// .artifactId("alpn-api").versionAsInProject(), +// mavenBundle().groupId("org.eclipse.jetty") +// .artifactId("jetty-alpn-java-server").versionAsInProject() +// ); + return common; } protected Option[] jettyWebSockets() { @@ -352,22 +355,22 @@ protected Option[] jettyWebSockets() { .artifactId("jetty-client").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty") .artifactId("jetty-alpn-client").versionAsInProject(), + mavenBundle().groupId("org.eclipse.jetty.ee10.websocket") + .artifactId("jetty-ee10-websocket-jakarta-common").versionAsInProject(), + mavenBundle().groupId("org.eclipse.jetty.ee10.websocket") + .artifactId("jetty-ee10-websocket-jakarta-client").versionAsInProject(), + mavenBundle().groupId("org.eclipse.jetty.ee10.websocket") + .artifactId("jetty-ee10-websocket-jakarta-server").versionAsInProject(), +// mavenBundle().groupId("org.eclipse.jetty.websocket") +// .artifactId("websocket-jetty-api").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-javax-common").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-javax-client").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-javax-server").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-jetty-api").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-core-common").versionAsInProject(), + .artifactId("jetty-websocket-core-common").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-core-client").versionAsInProject(), + .artifactId("jetty-websocket-core-client").versionAsInProject(), mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-core-server").versionAsInProject(), - mavenBundle().groupId("org.eclipse.jetty.websocket") - .artifactId("websocket-servlet").versionAsInProject(), + .artifactId("jetty-websocket-core-server").versionAsInProject(), + mavenBundle().groupId("org.eclipse.jetty.ee10.websocket") + .artifactId("jetty-ee10-websocket-servlet").versionAsInProject(), mavenBundle("org.ops4j.pax.web", "pax-web-websocket") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1) }; @@ -392,6 +395,8 @@ protected Option[] tomcatWebSockets() { return new Option[] { mavenBundle("jakarta.websocket", "jakarta.websocket-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), + mavenBundle("jakarta.websocket", "jakarta.websocket-client-api") + .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.ops4j.pax.web", "pax-web-tomcat-websocket") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.ops4j.pax.web", "pax-web-websocket") @@ -422,6 +427,8 @@ protected Option[] undertowWebSockets() { return new Option[] { mavenBundle("jakarta.websocket", "jakarta.websocket-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), + mavenBundle("jakarta.websocket", "jakarta.websocket-client-api") + .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("io.undertow", "undertow-websockets-jsr") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.ops4j.pax.web", "pax-web-undertow-websocket") @@ -499,8 +506,8 @@ protected Option[] myfacesDependencies() { .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("jakarta.el", "jakarta.el-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.interceptor", "jakarta.interceptor-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-interceptor12") @@ -526,18 +533,20 @@ protected Option[] myfaces() { Option[] options = new Option[] { mavenBundle("jakarta.websocket", "jakarta.websocket-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), + mavenBundle("jakarta.websocket", "jakarta.websocket-client-api") + .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("jakarta.el", "jakarta.el-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-el2") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.interceptor", "jakarta.interceptor-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-interceptor12") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-interceptor12") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.enterprise", "jakarta.enterprise.cdi-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).noStart(), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-cdi12") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-cdi12") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("commons-collections", "commons-collections") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("commons-beanutils", "commons-beanutils") @@ -566,6 +575,8 @@ protected Option[] ariesCdiAndMyfaces() { .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.websocket", "jakarta.websocket-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), + mavenBundle("jakarta.websocket", "jakarta.websocket-client-api") + .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), // it has to be CDI 1.2 for Myfaces 2.3.x, but can't conflict with CDI 2.0 needed by aries-cdi // mavenBundle("javax.enterprise", "cdi-api") // .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), @@ -599,15 +610,15 @@ protected Option[] ariesCdiAndMyfaces() { mavenBundle("jakarta.enterprise", "jakarta.enterprise.cdi-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).noStart(), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-cdi12") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-cdi12") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.interceptor", "jakarta.interceptor-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-interceptor12") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-interceptor12") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), // Aries CDI extension.servlet.weld and extension.el.jsp require JavaServlet 3.1 capability... - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-servlet31") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-servlet31") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).noStart(), mavenBundle("org.osgi", "org.osgi.service.cdi") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), @@ -657,8 +668,8 @@ protected Option[] ariesCdiAndMyfaces() { protected Option[] ariesJaxrs() { return new Option[] { - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-jaxrs2") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-jaxrs2") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.ws.rs", "jakarta.ws.rs-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("jakarta.xml.bind", "jakarta.xml.bind-api") @@ -669,8 +680,8 @@ protected Option[] ariesJaxrs() { .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("com.sun.activation", "javax.activation") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-servlet31") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-servlet31") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1).noStart(), mavenBundle("org.osgi", "org.osgi.service.jaxrs") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), @@ -719,8 +730,8 @@ protected Option[] primefaces() { return combine(myfaces(), mavenBundle("jakarta.persistence", "jakarta.persistence-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), - mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-jpa2") - .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), +// mavenBundle("org.ops4j.pax.web", "pax-web-compatibility-jpa2") +// .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 2).noStart(), mavenBundle("jakarta.xml.bind", "jakarta.xml.bind-api") .versionAsInProject().startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("com.sun.activation", "javax.activation") @@ -901,7 +912,7 @@ protected boolean isFulfilled() { } /** - * Creates a listener for deployment of named {@link javax.servlet.Servlet}. + * Creates a listener for deployment of named {@link jakarta.servlet.Servlet}. * @param servletName * @param action */ @@ -934,7 +945,7 @@ protected boolean isFulfilled() { } /** - * Creates a listener for deployment of a {@link javax.servlet.Servlet} mapped to some URL. + * Creates a listener for deployment of a {@link jakarta.servlet.Servlet} mapped to some URL. * @param mapping * @param action */ @@ -967,7 +978,7 @@ protected boolean isFulfilled() { } /** - * Creates a listener for deployment of a {@link javax.servlet.Filter} mapped to some URL. + * Creates a listener for deployment of a {@link jakarta.servlet.Filter} mapped to some URL. * @param mapping * @param action */ @@ -1132,8 +1143,8 @@ public static WebContainer getWebContainer(final BundleContext bundleContext) { } /** - * Creates {@link javax.servlet.Servlet} init parameters with legacy name that can be (which is deprecated, but - * the only way with pure {@link HttpService} to specify servlet name) used to configure {@link javax.servlet.Servlet} + * Creates {@link jakarta.servlet.Servlet} init parameters with legacy name that can be (which is deprecated, but + * the only way with pure {@link HttpService} to specify servlet name) used to configure {@link jakarta.servlet.Servlet} * name. * @param servletName * @return diff --git a/pax-web-itest/pax-web-itest-osgi/pom.xml b/pax-web-itest/pax-web-itest-osgi/pom.xml index fbad92b637..29543b6c7f 100644 --- a/pax-web-itest/pax-web-itest-osgi/pom.xml +++ b/pax-web-itest/pax-web-itest-osgi/pom.xml @@ -288,7 +288,7 @@ org.osgi - osgi.cmpn + org.osgi.service.servlet @@ -303,7 +303,7 @@ test - + jakarta.annotation @@ -313,7 +313,7 @@ jakarta.servlet jakarta.servlet-api - + test @@ -334,7 +334,7 @@ org.apache.logging.log4j - log4j-slf4j-impl + log4j-slf4j2-impl test diff --git a/pax-web-itest/pax-web-itest-osgi/readme.adoc b/pax-web-itest/pax-web-itest-osgi/readme.adoc index 855382013a..0d94117829 100644 --- a/pax-web-itest/pax-web-itest-osgi/readme.adoc +++ b/pax-web-itest/pax-web-itest-osgi/readme.adoc @@ -12,7 +12,7 @@ When using PaxExam native conainer (not Karaf container), we have two JVM instan PaxExam itself (before even starting any implementation of `org.ops4j.pax.exam.TestContainer`) uses Slf4J API, so we definitiely want two Maven dependencies in `test` scope: * org.slf4j:slf4j-api -* org.apache.logging.log4j:log4j-slf4j-impl +* org.apache.logging.log4j:log4j-slf4j2-impl And configuration file like `src/test/resources/log4j2-test.properties`. diff --git a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/ClassPathUtilIntegrationTest.java b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/ClassPathUtilIntegrationTest.java index 0f61695278..a3c2605cc8 100644 --- a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/ClassPathUtilIntegrationTest.java +++ b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/ClassPathUtilIntegrationTest.java @@ -63,7 +63,7 @@ public Option[] configure() { // to do it's job (like scanning for resources) mavenBundle("org.ops4j.pax.web.samples", "pax-web-spi-fragment").versionAsInProject().noStart(), - // bundle and two fragments to perform searching of /META-INF/services/javax.servlet.ServletContainerInitializer + // bundle and two fragments to perform searching of /META-INF/services/jakarta.servlet.ServletContainerInitializer mavenBundle("org.ops4j.pax.web.samples", "initializers").versionAsInProject(), mavenBundle("org.ops4j.pax.web.samples", "initializers-fragment1").versionAsInProject().noStart(), mavenBundle("org.ops4j.pax.web.samples", "initializers-fragment2").versionAsInProject().noStart(), diff --git a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebRuntimeIntegrationTest.java b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebRuntimeIntegrationTest.java index b7ceeaecef..603d06650e 100644 --- a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebRuntimeIntegrationTest.java +++ b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebRuntimeIntegrationTest.java @@ -24,7 +24,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import javax.inject.Inject; -import javax.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServlet; import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; @@ -37,6 +37,7 @@ import org.ops4j.pax.web.itest.osgi.support.MockServerController; import org.ops4j.pax.web.service.PaxWebConfig; import org.ops4j.pax.web.service.PaxWebConstants; +import org.ops4j.pax.web.service.http.HttpService; import org.ops4j.pax.web.service.spi.ServerController; import org.ops4j.pax.web.service.spi.ServerControllerFactory; import org.ops4j.pax.web.service.spi.task.Batch; @@ -46,7 +47,6 @@ import org.osgi.framework.ServiceListener; import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; -import org.osgi.service.http.HttpService; import org.osgi.service.metatype.AttributeDefinition; import org.osgi.service.metatype.MetaTypeInformation; import org.osgi.service.metatype.MetaTypeService; @@ -124,7 +124,7 @@ public void registerFakeServerControllerFactory() throws Exception { ServiceListener sl1 = (event) -> { if (event.getType() == ServiceEvent.REGISTERED) { String[] classes = (String[]) event.getServiceReference().getProperty(Constants.OBJECTCLASS); - if (Arrays.asList(classes).contains("org.osgi.service.http.HttpService")) { + if (Arrays.asList(classes).contains("org.ops4j.pax.web.service.http.HttpService")) { latch1.countDown(); } } @@ -157,7 +157,7 @@ public void sendBatch(Batch batch) { ServiceListener sl2 = (event) -> { if (event.getType() == ServiceEvent.UNREGISTERING) { String[] classes = (String[]) event.getServiceReference().getProperty(Constants.OBJECTCLASS); - if (Arrays.asList(classes).contains("org.osgi.service.http.HttpService")) { + if (Arrays.asList(classes).contains("org.ops4j.pax.web.service.http.HttpService")) { latch3.countDown(); } } @@ -186,7 +186,7 @@ public void checkTrackersForHttpServiceFactory() throws Exception { ServiceListener sl1 = (event) -> { if (event.getType() == ServiceEvent.REGISTERED) { String[] classes = (String[]) event.getServiceReference().getProperty(Constants.OBJECTCLASS); - if (Arrays.asList(classes).contains("org.osgi.service.http.HttpService")) { + if (Arrays.asList(classes).contains("org.ops4j.pax.web.service.http.HttpService")) { latch1.countDown(); } } diff --git a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebSpiIntegrationTest.java b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebSpiIntegrationTest.java index 124b4eec22..2f09044790 100644 --- a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebSpiIntegrationTest.java +++ b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/PaxWebSpiIntegrationTest.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Optional; import java.util.jar.Manifest; -import javax.servlet.ServletContainerInitializer; +import jakarta.servlet.ServletContainerInitializer; import org.apache.commons.io.IOUtils; import org.junit.Test; @@ -76,7 +76,7 @@ public Option[] configure() { mavenBundle("org.ow2.asm", "asm-commons").version(System.getProperty("version.asm")).startLevel(START_LEVEL_TEST_BUNDLE - 1), mavenBundle("org.ow2.asm", "asm-tree").version(System.getProperty("version.asm")).startLevel(START_LEVEL_TEST_BUNDLE - 1), - // bundle and two fragments to perform searching of /META-INF/services/javax.servlet.ServletContainerInitializer + // bundle and two fragments to perform searching of /META-INF/services/jakarta.servlet.ServletContainerInitializer mavenBundle("org.ops4j.pax.web.samples", "initializers").versionAsInProject(), mavenBundle("org.ops4j.pax.web.samples", "initializers-fragment1").versionAsInProject().noStart(), mavenBundle("org.ops4j.pax.web.samples", "initializers-fragment2").versionAsInProject().noStart(), diff --git a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/support/MockServerController.java b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/support/MockServerController.java index af2d8685a4..e40fb6ea29 100644 --- a/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/support/MockServerController.java +++ b/pax-web-itest/pax-web-itest-osgi/src/test/java/org/ops4j/pax/web/itest/osgi/support/MockServerController.java @@ -16,7 +16,7 @@ package org.ops4j.pax.web.itest.osgi.support; import java.net.URL; -import javax.servlet.Servlet; +import jakarta.servlet.Servlet; import org.ops4j.pax.web.service.spi.ServerController; import org.ops4j.pax.web.service.spi.ServerState; diff --git a/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/Bundle2Activator.java b/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/Bundle2Activator.java index e3296f8dad..737e8793aa 100644 --- a/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/Bundle2Activator.java +++ b/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/Bundle2Activator.java @@ -21,10 +21,10 @@ import org.ops4j.pax.web.service.PaxWebConstants; import org.ops4j.pax.web.service.WebContainer; +import org.ops4j.pax.web.service.http.HttpContext; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; -import org.osgi.service.http.HttpContext; public class Bundle2Activator implements BundleActivator { diff --git a/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/FilterBundleActivator.java b/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/FilterBundleActivator.java index b8d044e099..cb21e0bb3c 100644 --- a/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/FilterBundleActivator.java +++ b/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/FilterBundleActivator.java @@ -22,7 +22,7 @@ import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; -import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; +import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants; public class FilterBundleActivator implements BundleActivator { diff --git a/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/ServletBundleActivator.java b/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/ServletBundleActivator.java index 5168dc862f..9e2509ecfc 100644 --- a/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/ServletBundleActivator.java +++ b/pax-web-itest/pax-web-itest-utils/src/main/java/org/ops4j/pax/web/itest/utils/web/ServletBundleActivator.java @@ -20,11 +20,11 @@ import org.ops4j.pax.web.service.PaxWebConstants; import org.ops4j.pax.web.service.WebContainer; +import org.ops4j.pax.web.service.http.HttpContext; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; import org.osgi.framework.ServiceRegistration; -import org.osgi.service.http.HttpContext; public class ServletBundleActivator implements BundleActivator { diff --git a/pax-web-spi/pom.xml b/pax-web-spi/pom.xml index 72cce919af..91f9375eec 100644 --- a/pax-web-spi/pom.xml +++ b/pax-web-spi/pom.xml @@ -105,10 +105,10 @@ org.osgi.util.tracker;version="[1.5,2)", - org.osgi.service.servlet.context;version="[1.1,2)", - org.osgi.service.servlet.whiteboard;version="[1.1,2)", - org.osgi.service.servlet.runtime;version="[1.1,2)", - org.osgi.service.servlet.runtime.dto;version="[1.1,2)", + org.osgi.service.servlet.context;version="[2,3)", + org.osgi.service.servlet.whiteboard;version="[2,3)", + org.osgi.service.servlet.runtime;version="[2,3)", + org.osgi.service.servlet.runtime.dto;version="[2,3)", org.ops4j.pax.web.service;version="${pax-web.osgi.version}", diff --git a/pax-web-tomcat-common/pom.xml b/pax-web-tomcat-common/pom.xml index 1a51a07513..0c1e5e9ce3 100644 --- a/pax-web-tomcat-common/pom.xml +++ b/pax-web-tomcat-common/pom.xml @@ -57,7 +57,7 @@ org.ops4j.pax.web.service;version="${pax-web.osgi.version}", - org.apache.juli.logging, + org.apache.juli.logging;version="[9.0,11.0)", javax.management, diff --git a/samples/samples-jsf/jsf-primefaces-embedded-fragment/pom.xml b/samples/samples-jsf/jsf-primefaces-embedded-fragment/pom.xml index b6d0314da1..f77b91162c 100644 --- a/samples/samples-jsf/jsf-primefaces-embedded-fragment/pom.xml +++ b/samples/samples-jsf/jsf-primefaces-embedded-fragment/pom.xml @@ -47,7 +47,7 @@ --> org.ops4j.pax.web.samples.jsf-primefaces-commons2 - org.osgi.framework;version="[1.8,2)", + org.osgi.framework;version="[1.10,2)", * @@ -84,7 +84,7 @@ osgi.core - + jakarta.servlet diff --git a/samples/samples-jsf/jsf-primefaces-embedded/pom.xml b/samples/samples-jsf/jsf-primefaces-embedded/pom.xml index 42c515470e..a547bfeae7 100644 --- a/samples/samples-jsf/jsf-primefaces-embedded/pom.xml +++ b/samples/samples-jsf/jsf-primefaces-embedded/pom.xml @@ -70,32 +70,12 @@ --> org.ops4j.pax.web.samples.jsf-primefaces-commons1 - org.osgi.framework;version="[1.8,2)", - javax.servlet;version="[3.1,5)" - javax.servlet.http;version="[3.1,5)", + org.osgi.framework;version="[1.10,2)", + jakarta.servlet;version="[6,7)" + jakarta.servlet.http;version="[6,7)", org.ops4j.pax.web.samples.jsf3 * - - - - - - - - - - - - - - - - - - - - !* + jakarta.servlet diff --git a/samples/samples-war/war-simplest-osgi/pom.xml b/samples/samples-war/war-simplest-osgi/pom.xml index 46d6fbac04..3aa91ee40b 100644 --- a/samples/samples-war/war-simplest-osgi/pom.xml +++ b/samples/samples-war/war-simplest-osgi/pom.xml @@ -47,8 +47,8 @@ - org.osgi.framework;version="[1.8,2)", - javax.servlet.*;version="[3.1,5)", + org.osgi.framework;version="[1.10,2)", + jakarta.servlet.*;version="[6,7)", sun.nio.ch;resolution:=optional, * @@ -113,7 +113,7 @@ are packaged in WAR --> - + jakarta.servlet diff --git a/samples/samples-war/war-simplest-osgi/src/main/java/org/ops4j/pax/web/samples/war/osgi/SimplestServlet.java b/samples/samples-war/war-simplest-osgi/src/main/java/org/ops4j/pax/web/samples/war/osgi/SimplestServlet.java index 8f615d7ee5..73ce903fdb 100644 --- a/samples/samples-war/war-simplest-osgi/src/main/java/org/ops4j/pax/web/samples/war/osgi/SimplestServlet.java +++ b/samples/samples-war/war-simplest-osgi/src/main/java/org/ops4j/pax/web/samples/war/osgi/SimplestServlet.java @@ -17,10 +17,10 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServlet; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; public class SimplestServlet extends HttpServlet {