From dc8282d0a32848ab3aea329f62c6c0affac8529c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 13:58:18 +0100 Subject: [PATCH 01/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - 1.1.0-SNAPSHOT - Use jetty 12.1.0-alpha1 - Add `org.eclipse.jetty.compression.*` to exports - Add dependency on jetty-compression-gzip (not sure if this is required, maybe only for the client) and jetty-compression-common --- http/jetty12/pom.xml | 17 +++++++++++++++-- .../jetty/it/JakartaSpecificWebsocketIT.java | 2 ++ .../http/jetty/it/JettySpecificWebsocketIT.java | 2 ++ .../it/JettyUriComplianceModeDefaultIT.java | 4 +++- .../http/jetty/it/JettyVirtualThreadsIT.java | 4 +++- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 756c339c91..5060e35327 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -30,7 +30,7 @@ This is an implementation of the R8.1 OSGi Servlet Service, the R7 OSGi Http Service and the R7 OSGi Http Whiteboard Specification org.apache.felix.http.jetty12 - 1.0.20-SNAPSHOT + 1.1.0-SNAPSHOT bundle @@ -42,7 +42,7 @@ 17 - 12.0.16 + 12.1.0.alpha1 true 4.13.3 @@ -186,6 +186,7 @@ org.eclipse.jetty.ee.*, !org.eclipse.jetty.ee10.websocket.*, org.eclipse.jetty.ee10.servlet.*, + org.eclipse.jetty.compression.*, org.apache.felix.http.jetty, org.apache.felix.http.jakartawrappers, org.apache.felix.http.javaxwrappers @@ -377,6 +378,7 @@ !org.eclipse.jetty.ee10.websocket.jakarta.*, org.eclipse.jetty.ee10.websocket.*, org.eclipse.jetty.websocket.*, + org.eclipse.jetty.compression.*, org.apache.felix.http.jetty, org.apache.felix.http.jakartawrappers, org.apache.felix.http.javaxwrappers @@ -485,6 +487,7 @@ org.eclipse.jetty.ee10.websocket.jakarta.*, org.eclipse.jetty.ee10.servlet.*, org.eclipse.jetty.websocket.*, + org.eclipse.jetty.compression.*, org.apache.felix.http.jetty, org.apache.felix.http.jakartawrappers, org.apache.felix.http.javaxwrappers @@ -703,6 +706,16 @@ jetty-session ${jetty.version} + + org.eclipse.jetty.compression + jetty-compression-gzip + ${jetty.version} + + + org.eclipse.jetty.compression + jetty-compression-common + ${jetty.version} + org.osgi org.osgi.service.servlet diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java index 1c2ec9e613..bbb501577a 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java @@ -77,6 +77,8 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-gzip").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-server").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java index 63503f6e2b..eaeeab94bc 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java @@ -83,10 +83,12 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-jetty-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), // additional bundles for the client side mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-gzip").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-jetty-client").version(jettyVersion) }; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index b6595191e1..4e4ef4c847 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -63,10 +63,12 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), // additional bundles for the client side mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion) + mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-gzip").version(jettyVersion) }; } diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index e121116be3..65d664d242 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -64,10 +64,12 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), // additional bundles for the client side mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion) + mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-gzip").version(jettyVersion) }; } From 1ba9b6443a358e31ccd10519260ec7478e873342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 14:22:00 +0100 Subject: [PATCH 02/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Fix samples --- http/samples/whiteboard/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http/samples/whiteboard/pom.xml b/http/samples/whiteboard/pom.xml index aa08f324e0..b572cc0819 100644 --- a/http/samples/whiteboard/pom.xml +++ b/http/samples/whiteboard/pom.xml @@ -39,7 +39,7 @@ - 12.0.16 + 12.1.0.alpha1 @@ -78,7 +78,7 @@ jakarta.servlet jakarta.servlet-api - 5.0.0 + 6.1.0 provided @@ -96,7 +96,7 @@ org.apache.felix org.apache.felix.http.jetty12 - 1.0.20-SNAPSHOT + 1.1.0-SNAPSHOT provided From e98e1cf247e47a92b290cffbb30b946072d3976b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 21:13:30 +0100 Subject: [PATCH 03/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Move to EE11 - Skip baselining to prevent errors in the baseline phase because of changed API's in 6.1.0 --- http/README.md | 6 +-- http/base/pom.xml | 6 +-- http/itest/pom.xml | 4 +- http/jetty12/pom.xml | 38 +++++++++---------- .../http/jetty/internal/JettyService.java | 38 +++++++++---------- .../jetty/it/AbstractJettyTestSupport.java | 2 +- .../jetty/it/JakartaSpecificWebsocketIT.java | 16 ++++---- .../jetty/it/JettySpecificWebsocketIT.java | 8 ++-- .../it/JettyUriComplianceModeDefaultIT.java | 4 +- .../http/jetty/it/JettyVirtualThreadsIT.java | 4 +- .../http/jetty/it/LightClassifierIT.java | 2 +- .../it/MissingWebsocketDependenciesIT.java | 8 ++-- http/samples/whiteboard/pom.xml | 8 ++-- .../FelixJettyWebSocketServlet.java | 2 +- .../whiteboard/TestWebSocketServlet.java | 2 +- .../TestWebSocketServletAlternative.java | 2 +- http/servlet-api/pom.xml | 19 +++++++--- 17 files changed, 89 insertions(+), 80 deletions(-) diff --git a/http/README.md b/http/README.md index 8f3741b859..3777d8ce68 100644 --- a/http/README.md +++ b/http/README.md @@ -5,7 +5,7 @@ This is an implementation of the [R8.1 Whiteboard Specification for Jakarta Serv * Standard OSGi Http Service implementation * Standard OSGi Http Whiteboard implementation * Run either with Jetty (version 11 or 12) bundle or inside your own application server using the servlet bridge - * [Felix HTTP Jetty 12](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty12) is the preferred bundle of choice as it supports JakartaEE10 with the `jakarta` namespace. + * [Felix HTTP Jetty 12](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty12) is the preferred bundle of choice as it supports JakartaEE10 (1.0.x range) and JakartaEE11 (1.1.x range). * [Jetty WebSocket support](https://github.com/apache/felix-dev/pull/310), see example code [here](https://github.com/apache/felix-dev/blob/master/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServlet.java). * [Felix HTTP Jetty 11](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty) is the predecessor of the Jetty 12 bundle, which shipped with [Jetty 9.4.x](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty/4.2.26) in the 4.x range (JavaEE8), [Jetty 11.x](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty/5.1.10) in the 5.x range (JakartaEE9). * [Jetty WebSocket support](https://github.com/apache/felix-dev/pull/309), see example code [here](https://github.com/apache/felix-dev/blob/master/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServlet.java). @@ -15,9 +15,9 @@ This is an implementation of the [R8.1 Whiteboard Specification for Jakarta Serv The Apache Felix HTTP Service project includes several bundles. - * [`org.apache.felix.http.servlet-api`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.servlet-api) - Provides the Servlet API (versions 2.6, 3.0, 3.1, 4.0, 5.0 and 6.0 of the Servlet specification) + * [`org.apache.felix.http.servlet-api`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.servlet-api) - Provides the Servlet API (versions 2.6, 3.0, 3.1, 4.0, 5.0, 6.0 (3.0.0) and 6.1 (since 3.1.0) of the Servlet specification) * [`org.apache.felix.http.api`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.api) - Provides the OSGi APIs for the Http Whiteboard and Http Service. - * [`org.apache.felix.http.jetty12`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty12) - Implementation that is embedding Jetty server (currently Jetty 12.x, requiring Java 17). This bundle includes the http.api bundle. It's the the preferred Felix Jetty bundle to use, as Jetty 11 will be [EoL in 2025](https://github.com/jetty/jetty.project/issues/10485). + * [`org.apache.felix.http.jetty12`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty12) - Implementation that is embedding Jetty server (currently Jetty 12.1.x, requiring Java 17). This bundle includes the http.api bundle. It's the the preferred Felix Jetty bundle to use, as Jetty 11 will be [EoL in 2025](https://github.com/jetty/jetty.project/issues/10485). * [`org.apache.felix.http.jetty`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty) - Predecessor implementation that is embedding Jetty server (currently Jetty 11.x, requiring Java 11). This bundle includes the http.api bundle. * [`org.apache.felix.http.sslfilter`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.sslfilter) - Servlet filter for handling SSL termination. * [`org.apache.felix.http.bridge`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.bridge) - Implementation that uses the host application server (bridged mode). Must be used with the proxy (see below) diff --git a/http/base/pom.xml b/http/base/pom.xml index bd6eeea198..129937bc88 100644 --- a/http/base/pom.xml +++ b/http/base/pom.xml @@ -28,7 +28,7 @@ Apache Felix Http Base org.apache.felix.http.base - 5.1.9-SNAPSHOT + 6.0.0-SNAPSHOT jar @@ -68,7 +68,7 @@ ${project.artifactId} ${project.version} - + @@ -99,7 +99,7 @@ jakarta.servlet jakarta.servlet-api - 6.0.0 + 6.1.0 provided diff --git a/http/itest/pom.xml b/http/itest/pom.xml index 670c86a0b9..e021e9f6d8 100644 --- a/http/itest/pom.xml +++ b/http/itest/pom.xml @@ -44,8 +44,8 @@ jetty12 17 - 3.0.0 - 1.0.20-SNAPSHOT + 3.1.0-SNAPSHOT + 1.1.0-SNAPSHOT org.apache.felix.http.jetty12 diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 5060e35327..7f651c8ea1 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -75,9 +75,9 @@ if (artifact.getArtifactHandler().isAddedToClasspath() && !org.apache.maven.artifact.Artifact.SCOPE_TEST.equals( artifact.getScope() ) && !"org.eclipse.jetty.websocket".equals(artifact.getGroupId()) // skip the optional websocket artifacts - && !"org.eclipse.jetty.ee10.websocket".equals(artifact.getGroupId()) // skip the optional websocket artifacts - && !"jetty-annotations".equals(artifact.getArtifactId()) // skip the transitive artifacts from the optional websocket artifacts - && !"jetty-plus".equals(artifact.getArtifactId()) + && !"org.eclipse.jetty.ee11.websocket".equals(artifact.getGroupId()) // skip the optional websocket artifacts + && !"jetty-ee11-annotations".equals(artifact.getArtifactId()) // skip the transitive artifacts from the optional websocket artifacts + && !"jetty-ee11-plus".equals(artifact.getArtifactId()) && !"jetty-webapp".equals(artifact.getArtifactId()) && !"jetty-ee".equals(artifact.getArtifactId())) { def jar; @@ -184,8 +184,8 @@ org.eclipse.jetty.server.*, org.eclipse.jetty.util.*, org.eclipse.jetty.ee.*, - !org.eclipse.jetty.ee10.websocket.*, - org.eclipse.jetty.ee10.servlet.*, + !org.eclipse.jetty.ee11.websocket.*, + org.eclipse.jetty.ee11.servlet.*, org.eclipse.jetty.compression.*, org.apache.felix.http.jetty, org.apache.felix.http.jakartawrappers, @@ -374,9 +374,9 @@ org.eclipse.jetty.server.*, org.eclipse.jetty.util.*, org.eclipse.jetty.ee.*, - org.eclipse.jetty.ee10.servlet.*, - !org.eclipse.jetty.ee10.websocket.jakarta.*, - org.eclipse.jetty.ee10.websocket.*, + org.eclipse.jetty.ee11.servlet.*, + !org.eclipse.jetty.ee11.websocket.jakarta.*, + org.eclipse.jetty.ee11.websocket.*, org.eclipse.jetty.websocket.*, org.eclipse.jetty.compression.*, org.apache.felix.http.jetty, @@ -482,10 +482,10 @@ org.eclipse.jetty.server.*, org.eclipse.jetty.util.*, org.eclipse.jetty.ee.*, - !org.eclipse.jetty.ee10.websocket.server.*, - !org.eclipse.jetty.ee10.websocket.servlet.*, - org.eclipse.jetty.ee10.websocket.jakarta.*, - org.eclipse.jetty.ee10.servlet.*, + !org.eclipse.jetty.ee11.websocket.server.*, + !org.eclipse.jetty.ee11.websocket.servlet.*, + org.eclipse.jetty.ee11.websocket.jakarta.*, + org.eclipse.jetty.ee11.servlet.*, org.eclipse.jetty.websocket.*, org.eclipse.jetty.compression.*, org.apache.felix.http.jetty, @@ -634,8 +634,8 @@ provided - org.eclipse.jetty.ee10 - jetty-ee10-servlet + org.eclipse.jetty.ee11 + jetty-ee11-servlet ${jetty.version} @@ -684,14 +684,14 @@ ${jetty.version} - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jakarta-server + org.eclipse.jetty.ee11.websocket + jetty-ee11-websocket-jakarta-server ${jetty.version} true - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jetty-server + org.eclipse.jetty.ee11.websocket + jetty-ee11-websocket-jetty-server ${jetty.version} true @@ -737,7 +737,7 @@ org.apache.felix org.apache.felix.http.base - 5.1.9-SNAPSHOT + 6.0.0-SNAPSHOT org.apache.felix diff --git a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java index efe4f8fb83..7cebcf0b4f 100644 --- a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java +++ b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java @@ -38,10 +38,10 @@ import org.apache.felix.http.base.internal.HttpServiceController; import org.apache.felix.http.base.internal.logger.SystemLogger; import org.eclipse.jetty.alpn.server.ALPNServerConnectionFactory; -import org.eclipse.jetty.ee10.servlet.ServletContextHandler; -import org.eclipse.jetty.ee10.servlet.ServletHolder; -import org.eclipse.jetty.ee10.servlet.SessionHandler; -import org.eclipse.jetty.ee10.servlet.ServletHandler; +import org.eclipse.jetty.ee11.servlet.ServletContextHandler; +import org.eclipse.jetty.ee11.servlet.ServletHolder; +import org.eclipse.jetty.ee11.servlet.SessionHandler; +import org.eclipse.jetty.ee11.servlet.ServletHandler; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.UriCompliance; import org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory; @@ -555,32 +555,32 @@ private boolean initializeHttps() * @param handler the sevlet context handler to initialize */ private void maybeInitializeJakartaWebsocket(ServletContextHandler handler) { - if (isClassNameVisible("org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer")) { + if (isClassNameVisible("org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer")) { // Ensure that JakartaWebSocketServletContainerInitializer is initialized, // to setup the ServerContainer for this web application context. - org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer.configure(handler, null); - SystemLogger.LOGGER.info("Jakarta WebSocket EE10 servlet container initialized"); + org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer.configure(handler, null); + SystemLogger.LOGGER.info("Jakarta WebSocket ee11 servlet container initialized"); } else { - SystemLogger.LOGGER.warn("Failed to initialize jakarta EE10 standard websocket support since the initializer class was not found. " - + "Check if the jetty-ee10-websocket-jakarta-server bundle is deployed."); + SystemLogger.LOGGER.warn("Failed to initialize jakarta ee11 standard websocket support since the initializer class was not found. " + + "Check if the jetty-ee11-websocket-jakarta-server bundle is deployed."); } } /** - * Initialize the jetty EE10 websocket support for the servlet context handler. + * Initialize the jetty ee11 websocket support for the servlet context handler. * If the optional initializer class is not present then a warning will be logged. * * @param handler the sevlet context handler to initialize */ private void maybeInitializeJettyWebsocket(ServletContextHandler handler) { - if (isClassNameVisible("org.eclipse.jetty.ee10.websocket.server.config.JettyWebSocketServletContainerInitializer")) { + if (isClassNameVisible("org.eclipse.jetty.ee11.websocket.server.config.JettyWebSocketServletContainerInitializer")) { // Ensure that JettyWebSocketServletContainerInitializer is initialized, // to setup the JettyWebSocketServerContainer for this web application context. - org.eclipse.jetty.ee10.websocket.server.config.JettyWebSocketServletContainerInitializer.configure(handler, null); - SystemLogger.LOGGER.info("Jetty WebSocket EE10 servlet container initialized"); + org.eclipse.jetty.ee11.websocket.server.config.JettyWebSocketServletContainerInitializer.configure(handler, null); + SystemLogger.LOGGER.info("Jetty WebSocket ee11 servlet container initialized"); } else { - SystemLogger.LOGGER.warn("Failed to initialize jetty EE10 specific websocket support since the initializer class was not found. " - + "Check if the jetty-ee10-websocket-jetty-server bundle is deployed."); + SystemLogger.LOGGER.warn("Failed to initialize jetty ee11 specific websocket support since the initializer class was not found. " + + "Check if the jetty-ee11-websocket-jetty-server bundle is deployed."); } } @@ -593,13 +593,13 @@ private void maybeStoreWebSocketContainerAttributes(ServletContextHandler contex // when the server is started, retrieve the container attribute and // set it on the shared servlet context once available if (this.config.isUseJettyWebsocket() && - isClassNameVisible("org.eclipse.jetty.ee10.websocket.server.config.JettyWebSocketServletContainerInitializer")) { - String attribute = org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServerContainer.JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE; + isClassNameVisible("org.eclipse.jetty.ee11.websocket.server.config.JettyWebSocketServletContainerInitializer")) { + String attribute = org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServerContainer.JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE; this.controller.setAttributeSharedServletContext(attribute, context.getServletContext().getAttribute(attribute)); } if (this.config.isUseJakartaWebsocket() && - isClassNameVisible("org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer")) { - String attribute = org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer.ATTR_JAKARTA_SERVER_CONTAINER; + isClassNameVisible("org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer")) { + String attribute = org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer.ATTR_JAKARTA_SERVER_CONTAINER; this.controller.setAttributeSharedServletContext(attribute, context.getServletContext().getAttribute(attribute)); } } diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index dff9417708..6b16a5f34e 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -78,7 +78,7 @@ public Option[] configuration() throws IOException { localMavenRepo(), CoreOptions.workingDirectory(workingDirectory()), optionalRemoteDebug(), - mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.0.0"), + mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.1.0-SNAPSHOT"), testBundle("bundle.filename"), junitBundles(), awaitility(), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java index bbb501577a..f1e7458044 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java @@ -43,7 +43,7 @@ import jakarta.websocket.server.ServerEndpoint; import org.awaitility.Awaitility; -import org.eclipse.jetty.ee10.websocket.jakarta.client.JakartaWebSocketClientContainerProvider; +import org.eclipse.jetty.ee11.websocket.jakarta.client.JakartaWebSocketClientContainerProvider; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; @@ -71,21 +71,21 @@ protected Option[] additionalOptions() throws IOException { spifly(), // bundles for the server side - mavenBundle().groupId("jakarta.websocket").artifactId("jakarta.websocket-api").version("2.1.1"), - mavenBundle().groupId("jakarta.websocket").artifactId("jakarta.websocket-client-api").version("2.1.1"), + mavenBundle().groupId("jakarta.websocket").artifactId("jakarta.websocket-api").version("2.2.0"), + mavenBundle().groupId("jakarta.websocket").artifactId("jakarta.websocket-client-api").version("2.2.0"), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-gzip").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-server").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-jakarta-client").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-jakarta-common").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-jakarta-server").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-jakarta-client").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-jakarta-common").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-jakarta-server").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion) }; } diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java index eaeeab94bc..65f32d50b7 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java @@ -38,7 +38,7 @@ import org.awaitility.Awaitility; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; -import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServerContainer; +import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServerContainer; import org.eclipse.jetty.websocket.api.Callback; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketMessage; @@ -73,14 +73,14 @@ protected Option[] additionalOptions() throws IOException { spifly(), // bundles for the server side - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-jetty-api").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-jetty-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-jetty-server").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-servlet").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10.websocket").artifactId("jetty-ee10-websocket-jetty-server").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-jetty-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index 4e4ef4c847..5c79f70a1d 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -59,9 +59,9 @@ protected Option[] additionalOptions() throws IOException { spifly(), // bundles for the server side - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index 65d664d242..d63d0aa09a 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -60,9 +60,9 @@ protected Option[] additionalOptions() throws IOException { spifly(), // bundles for the server side - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java index 97a0994ba9..ced6565ce6 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java @@ -71,7 +71,7 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-security").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-session").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-util").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java index 141b522214..6a0dd54ab1 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/MissingWebsocketDependenciesIT.java @@ -68,11 +68,11 @@ public void testMissingDepencencyWarningLogs() throws Exception { .until(() -> containsString(logFile, "org.apache.felix.http.jetty12[org.apache.felix.http]")); assertTrue(containsString(logFile, "org.apache.felix.http.jetty12[org.apache.felix.http] : Failed to " - + "initialize jetty EE10 specific websocket support since the initializer class was not found. " - + "Check if the jetty-ee10-websocket-jetty-server bundle is deployed.")); + + "initialize jetty ee11 specific websocket support since the initializer class was not found. " + + "Check if the jetty-ee11-websocket-jetty-server bundle is deployed.")); assertTrue(containsString(logFile, "org.apache.felix.http.jetty12[org.apache.felix.http] : Failed to " - + "initialize jakarta EE10 standard websocket support since the initializer class was not found. " - + "Check if the jetty-ee10-websocket-jakarta-server bundle is deployed.")); + + "initialize jakarta ee11 standard websocket support since the initializer class was not found. " + + "Check if the jetty-ee11-websocket-jakarta-server bundle is deployed.")); } /** diff --git a/http/samples/whiteboard/pom.xml b/http/samples/whiteboard/pom.xml index b572cc0819..c88b48d750 100644 --- a/http/samples/whiteboard/pom.xml +++ b/http/samples/whiteboard/pom.xml @@ -112,14 +112,14 @@ provided - org.eclipse.jetty.ee10 - jetty-ee10-servlet + org.eclipse.jetty.ee11 + jetty-ee11-servlet ${jetty.version} provided - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jetty-server + org.eclipse.jetty.ee11.websocket + jetty-ee11-websocket-jetty-server ${jetty.version} provided diff --git a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/FelixJettyWebSocketServlet.java b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/FelixJettyWebSocketServlet.java index 55af0f1863..c25d4a6b26 100644 --- a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/FelixJettyWebSocketServlet.java +++ b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/FelixJettyWebSocketServlet.java @@ -24,7 +24,7 @@ import jakarta.servlet.ServletRequest; import jakarta.servlet.ServletResponse; -import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServlet; +import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServlet; /** * Abstract class that hides all Jetty Websocket specifics and provides a way for the developer to focus on the actual WebSocket implementation. diff --git a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServlet.java b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServlet.java index 77c1bd1c5c..f6685412b9 100644 --- a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServlet.java +++ b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServlet.java @@ -21,7 +21,7 @@ import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServlet; -import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServerContainer; +import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServerContainer; import org.eclipse.jetty.websocket.api.Callback; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; diff --git a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java index e916a9a3ff..c3654e6a6e 100644 --- a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java +++ b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java @@ -19,7 +19,7 @@ import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletException; -import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServletFactory; +import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServletFactory; import org.eclipse.jetty.websocket.api.Callback; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; diff --git a/http/servlet-api/pom.xml b/http/servlet-api/pom.xml index bfbb4de269..326bf9ef57 100644 --- a/http/servlet-api/pom.xml +++ b/http/servlet-api/pom.xml @@ -21,9 +21,14 @@ Apache Felix Servlet API Provides the Servlet API for use by applications org.apache.felix.http.servlet-api - 3.0.1-SNAPSHOT + 3.1.0-SNAPSHOT bundle + + + true + + scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git @@ -59,7 +64,7 @@ org.apache.felix maven-bundle-plugin - 5.1.9 + 6.0.0 true @@ -104,13 +109,17 @@ jakarta.servlet;version=6.0;uses:="jakarta.servlet.annotation,jakarta.servlet.descriptor", jakarta.servlet.annotation;version=6.0;uses:="jakarta.servlet", jakarta.servlet.descriptor;version=6.0, - jakarta.servlet.http;version=6.0;uses:="jakarta.servlet" + jakarta.servlet.http;version=6.0;uses:="jakarta.servlet", + jakarta.servlet;version=6.1;uses:="jakarta.servlet.annotation,jakarta.servlet.descriptor", + jakarta.servlet.annotation;version=6.1;uses:="jakarta.servlet", + jakarta.servlet.descriptor;version=6.1, + jakarta.servlet.http;version=6.1;uses:="jakarta.servlet" !* osgi.contract;osgi.contract="JavaServlet";version:List<Version>="2.6,3.0,3.1,4.0"; uses:="javax.servlet,javax.servlet.http,javax.servlet.descriptor,javax.servlet.annotation", - osgi.contract;osgi.contract="JakartaServlet";version:List<Version>="5.0,6.0"; + osgi.contract;osgi.contract="JakartaServlet";version:List<Version>="5.0,6.0,6.1"; uses:="jakarta.servlet,jakarta.servlet.http,jakarta.servlet.descriptor,jakarta.servlet.annotation" tomcat-servlet-api;inline=true,jakarta.servlet-api;inline=true @@ -129,7 +138,7 @@ jakarta.servlet jakarta.servlet-api - 6.0.0 + 6.1.0 From 720e3952e76702d5cf9464b646d86c2ca1f45c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 21:41:27 +0100 Subject: [PATCH 04/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Pass local maven repo to be able to get to the snapshot version of the servlet-api bundle --- .github/workflows/maven-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index a9026ce8de..01e791ad3c 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -48,7 +48,7 @@ jobs: run: mvn -B -V -Dstyle.color=always --file scr/pom.xml clean verify - name: Felix HTTP if: steps.changes.outputs.http == 'true' - run: mvn -B -V -Dstyle.color=always "-Dit.test=!MissingWebsocketDependenciesIT" --file http/pom.xml clean install verify + run: mvn -B -V -Dstyle.color=always "-Dit.test=!MissingWebsocketDependenciesIT" --file http/pom.xml clean install verify "-Dmaven.repo.local=/home/runner/.m2/repository/" - name: Felix Maven bundle plugin if: steps.changes.outputs.maven-bundle-plugin == 'true' run: mvn -B -V -Dstyle.color=always --file tools/maven-bundle-plugin/pom.xml clean install verify From ba7ee7d73658bd3ba744dd81f2fcf198411177f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 21:44:00 +0100 Subject: [PATCH 05/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Use snapshot version --- http/jetty/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index 4c8b748dc5..e87889f6ca 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -494,7 +494,7 @@ org.apache.felix org.apache.felix.http.base - 5.1.9-SNAPSHOT + 6.0.0-SNAPSHOT org.apache.felix From 973bf302460f0511f4f074608cea91b73a452ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 21:55:49 +0100 Subject: [PATCH 06/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Build servlet-api, as it's used in the Jetty bundles --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 97f623fe7b..96c95ea35d 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -43,11 +43,11 @@ bridge inventoryprinter itest + servlet-api jetty jetty12 proxy samples/whiteboard - servlet-api sslfilter webconsoleplugin wrappers From 00a3c42aa9fd846723cb48d1527a0d92e9ab4833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 22:08:47 +0100 Subject: [PATCH 07/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Update README.md --- http/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/README.md b/http/README.md index 3777d8ce68..25a850d3ed 100644 --- a/http/README.md +++ b/http/README.md @@ -31,8 +31,8 @@ classpath and deployment! ### Using classifiers: `light`, `with-jetty-websockets` and `with-jakarta-websockets` bundle If you would like to use your own Jetty jars instead of the one packaged with the Felix Jetty bundles, you can use the variants with the following classifiers: * `light` - A light version of the bundle that does not include the Jetty classes. This is useful when you want to use your own Jetty jars. Available for both Jetty bundles. -* `with-jetty-websockets` - A bundle that includes the classes required for Jetty WebSocket support for Jakarta EE10. Jetty12 bundle only. -* `with-jakarta-websockets` - A bundle that includes the classes required for Jakarta WebSocket support for Jakarta EE10. Jetty12 bundle only. +* `with-jetty-websockets` - A bundle that includes the classes required for Jetty WebSocket support for Jakarta EE10 (1.0.x) and Jakarta EE11 (1.1.x). Jetty12 bundle only. +* `with-jakarta-websockets` - A bundle that includes the classes required for Jakarta WebSocket support for Jakarta EE10 (1.0.x) and Jakarta EE11 (1.1.x). Jetty12 bundle only. When building the Felix Jetty bundle with Maven (`mvn clean install`), the additional bundles will be created in the `target` directory, postfixed with classifier. This jar can be deployed to your Felix OSGi environment, along with a compatible Jetty jars. From eb61dc7817ec358159819d1e14f077f6d03d1a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 20 Jan 2025 22:36:52 +0100 Subject: [PATCH 08/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Update wrappers to implement new methods for servlet-api 6.1. This will break backwards compatbility though --- http/jetty12/pom.xml | 2 +- http/wrappers/pom.xml | 7 +++-- .../HttpServletRequestWrapper.java | 11 +++++++ .../HttpServletResponseWrapper.java | 29 +++++++++++++++++-- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 7f651c8ea1..444c558bfe 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -742,7 +742,7 @@ org.apache.felix org.apache.felix.http.wrappers - 1.1.8 + 1.2.0-SNAPSHOT commons-fileupload diff --git a/http/wrappers/pom.xml b/http/wrappers/pom.xml index 12f0dbe670..26f7845667 100644 --- a/http/wrappers/pom.xml +++ b/http/wrappers/pom.xml @@ -28,7 +28,7 @@ Apache Felix Http Wrappers org.apache.felix.http.wrappers - 1.1.9-SNAPSHOT + 1.2.0-SNAPSHOT bundle @@ -40,6 +40,7 @@ 11 + true @@ -47,7 +48,7 @@ org.apache.felix maven-bundle-plugin - 5.1.9 + 6.0.0 true @@ -96,7 +97,7 @@ jakarta.servlet jakarta.servlet-api - 6.0.0 + 6.1.0 provided diff --git a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletRequestWrapper.java b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletRequestWrapper.java index d971ef0bdd..31505f7cfe 100644 --- a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletRequestWrapper.java +++ b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletRequestWrapper.java @@ -17,6 +17,8 @@ package org.apache.felix.http.jakartawrappers; import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.nio.charset.Charset; import java.security.Principal; import java.util.ArrayList; import java.util.Collection; @@ -263,4 +265,13 @@ public Map getTrailerFields() { public boolean isTrailerFieldsReady() { return this.request.isTrailerFieldsReady(); } + + @Override + public void setCharacterEncoding(Charset charset) { + try { + this.request.setCharacterEncoding(charset.name()); + } catch (UnsupportedEncodingException e) { + throw new IllegalArgumentException(e); + } + } } diff --git a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java index 86d73e21c7..d5959a508f 100644 --- a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java +++ b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java @@ -17,13 +17,14 @@ package org.apache.felix.http.jakartawrappers; import java.io.IOException; +import java.nio.charset.Charset; import java.util.Collection; -import org.jetbrains.annotations.NotNull; - import jakarta.servlet.http.Cookie; import jakarta.servlet.http.HttpServletResponse; +import org.jetbrains.annotations.NotNull; + /** * Http servlet response wrapper */ @@ -76,6 +77,25 @@ public void sendRedirect(final String location) throws IOException { this.response.sendRedirect(location); } + @Override + public void sendRedirect(String location, boolean clearBuffer) throws IOException { + this.response.sendRedirect(location); + this.response.flushBuffer(); + } + + @Override + public void sendRedirect(String location, int sc) throws IOException { + this.response.setStatus(sc); + this.response.sendRedirect(location); + } + + @Override + public void sendRedirect(String location, int sc, boolean clearBuffer) throws IOException { + this.response.setStatus(sc); + this.response.sendRedirect(location); + this.response.flushBuffer(); + } + @Override public void setDateHeader(final String name, final long date) { this.response.setDateHeader(name, date); @@ -130,4 +150,9 @@ public Collection getHeaders(final String name) { public Collection getHeaderNames() { return this.response.getHeaderNames(); } + + @Override + public void setCharacterEncoding(Charset encoding) { + this.response.setCharacterEncoding(encoding.name()); + } } From 437c40ff94e63e20bc883a2fe7962376f0e539a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Wed, 22 Jan 2025 09:56:24 +0100 Subject: [PATCH 09/72] FELIX-6750 Try out Jetty 12.1.0 in Felix HTTP - Fix samples --- .../http/samples/whiteboard/TestWebSocketServletAlternative.java | 1 + 1 file changed, 1 insertion(+) diff --git a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java index c734d37d9b..85ebba1b3e 100644 --- a/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java +++ b/http/samples/whiteboard/src/main/java/org/apache/felix/http/samples/whiteboard/TestWebSocketServletAlternative.java @@ -19,6 +19,7 @@ import jakarta.servlet.ServletConfig; import jakarta.servlet.ServletException; +import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServlet; import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServletFactory; import org.eclipse.jetty.websocket.api.Callback; import org.eclipse.jetty.websocket.api.Session; From e2090d2ace90abf25f9cc07106eb44fee999955c Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 18 Mar 2025 22:11:13 +0100 Subject: [PATCH 10/72] Upgrade to Alpha2 --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 444c558bfe..265841a47b 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -42,7 +42,7 @@ 17 - 12.1.0.alpha1 + 12.1.0.alpha2 true 4.13.3 From 1197c4892fd1b1bd12bcdf37cb807b93c48bfc8b Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 2 Feb 2025 13:24:04 +0100 Subject: [PATCH 11/72] FELIX-6751 : Use proper encoding for service filter --- .../felix/webconsole/internal/core/ServicesServlet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java index 3b8a89b5a6..e2b8d7d241 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/ServicesServlet.java @@ -114,7 +114,7 @@ static RequestInfo getRequestInfo( final HttpServletRequest request ) private final String TEMPLATE; - /** + /** * Default constructor * @throws IOException If template can't be read */ @@ -122,7 +122,7 @@ public ServicesServlet() throws IOException { // load templates TEMPLATE = readTemplateFile( "/templates/services.html" ); } - + @Override protected String getCategory() { return CATEGORY_OSGI; @@ -466,7 +466,7 @@ public void renderContent( HttpServletRequest request, HttpServletResponse respo vars.put( "bundlePath", appRoot + "/" + BundlesServlet.NAME + "/" ); vars.put( "drawDetails", String.valueOf(reqInfo.serviceRequested)); vars.put( "__data__", w.toString() ); - vars.put( "filter", filter == null ? "" : Encode.forHtmlContent(filter) ); + vars.put( "filter", filter == null ? "" : Encode.forJavaScript(filter)); response.getWriter().print( TEMPLATE ); } From 49e4232bab755a09d92b17db836bf4f91cf5813b Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 2 Feb 2025 13:28:28 +0100 Subject: [PATCH 12/72] [maven-release-plugin] prepare release org.apache.felix.webconsole-5.0.10 --- webconsole/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webconsole/pom.xml b/webconsole/pom.xml index 7ab69c5ca5..71d5882061 100644 --- a/webconsole/pom.xml +++ b/webconsole/pom.xml @@ -28,7 +28,7 @@ org.apache.felix.webconsole bundle - 5.0.9-SNAPSHOT + 5.0.10 Apache Felix Web Management Console @@ -46,7 +46,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - HEAD + org.apache.felix.webconsole-5.0.10 From 0dba53c729b0c6ee695868c010fa71f5361c3940 Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 2 Feb 2025 13:28:30 +0100 Subject: [PATCH 13/72] [maven-release-plugin] prepare for next development iteration --- webconsole/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webconsole/pom.xml b/webconsole/pom.xml index 71d5882061..0a901cb9b8 100644 --- a/webconsole/pom.xml +++ b/webconsole/pom.xml @@ -28,7 +28,7 @@ org.apache.felix.webconsole bundle - 5.0.10 + 5.0.11-SNAPSHOT Apache Felix Web Management Console @@ -46,7 +46,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.webconsole-5.0.10 + HEAD From 49a5178e3547472670bc88a15bd9f551b32d25fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 3 Feb 2025 11:54:23 +0100 Subject: [PATCH 14/72] Add webconsole to CI pipeline --- .github/workflows/maven-ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index ec70c91f49..e328bf94dc 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -8,6 +8,7 @@ on: - 'http/**' - 'tools/maven-bundle-plugin/**' - 'tools/osgicheck-maven-plugin/**' + - 'webconsole/**' pull_request: branches: [ "master" ] paths: @@ -15,6 +16,7 @@ on: - 'http/**' - 'tools/maven-bundle-plugin/**' - 'tools/osgicheck-maven-plugin/**' + - 'webconsole/**' permissions: {} @@ -46,7 +48,8 @@ jobs: - 'tools/maven-bundle-plugin/**' maven-osgicheck-plugin: - 'tools/osgicheck-maven-plugin/**' - + webconsole: + - 'webconsole/**' - name: Felix SCR if: steps.changes.outputs.scr == 'true' run: mvn -B -V -Dstyle.color=always --file scr/pom.xml clean verify @@ -59,6 +62,9 @@ jobs: - name: Felix Maven OSGi check plugin if: steps.changes.outputs.maven-osgicheck-plugin == 'true' run: mvn -B -V -Dstyle.color=always --file tools/osgicheck-maven-plugin/pom.xml clean install verify + - name: Felix Webconsole + if: steps.changes.outputs.webconsole == 'true' + run: mvn -B -V -Dstyle.color=always --file webconsole/pom.xml clean install verify - name: Upload Test Results if: always() uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 From 738ff8fd4d252e6e082c8346d08f418406e2871d Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Tue, 4 Feb 2025 06:54:33 +0100 Subject: [PATCH 15/72] FELIX-6752 : System information throws java.lang.ClassCastException --- .../internal/servlet/OsgiManager.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java index d03786b762..1e3516def5 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/servlet/OsgiManager.java @@ -129,7 +129,7 @@ public class OsgiManager extends HttpServlet { static final String PROP_ENABLE_SECRET_HEURISTIC = "secret.heuristic.enabled"; static final String PROP_HTTP_SERVICE_SELECTOR = "http.service.filter"; - + /** The framework shutdown timeout */ public static final String PROP_SHUTDOWN_TIMEOUT = "shutdown.timeout"; @@ -203,10 +203,10 @@ public class OsgiManager extends HttpServlet { // not-null when the ServletContextHelper service is registered private volatile ServiceRegistration servletContextRegistration; - + // not-null when the main servlet and the resources are registered private volatile ServiceRegistration servletRegistration; - + // default configuration from framework properties private Map defaultConfiguration; @@ -266,7 +266,7 @@ public OsgiManager(BundleContext bundleContext) { ConfigurationUtil.getProperty( bundleContext, FRAMEWORK_SHUTDOWN_TIMEOUT, DEFAULT_SHUTDOWN_TIMEOUT ) ); this.defaultConfiguration.put( PROP_RELOAD_TIMEOUT, ConfigurationUtil.getProperty( bundleContext, FRAMEWORK_RELOAD_TIMEOUT, DEFAULT_RELOAD_TIMEOUT ) ); - + // configure and start listening for configuration updateConfiguration(null); @@ -821,7 +821,7 @@ synchronized void registerHttpWhiteboardServices() { props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN, "/res/*"); props.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX, "/res"); - this.servletRegistration = getBundleContext().registerService(Servlet.class, this, props); + this.servletRegistration = getBundleContext().registerService(Servlet.class, this, props); } } catch (final Exception e) { Util.LOGGER.error("registerHttpWhiteboardServices: Problem setting up", e); @@ -872,7 +872,16 @@ synchronized void updateConfiguration( final Dictionary osgiConfig) { if ( osgiConfig != null ) { for ( Enumeration keys = osgiConfig.keys(); keys.hasMoreElements(); ) { final String key = keys.nextElement(); - config.put( key, osgiConfig.get( key ) ); + final Object value = osgiConfig.get( key ); + if (PROP_SHUTDOWN_TIMEOUT.equals(key) || PROP_RELOAD_TIMEOUT.equals(key)) { + try { + config.put(key, Integer.parseInt(value.toString())); + } catch (final NumberFormatException nfe) { + Util.LOGGER.warn("Ignoring invalid value for {}: {}", key, value); + } + } else { + config.put(key, value); + } } } From 82abeb8f86aa0882e808617e3876431bbf87d115 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 06:57:55 +0100 Subject: [PATCH 16/72] Bump ch.qos.logback:logback-core in /ipojo/handler/jmx/jmx-handler-it (#375) Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.3.12 to 1.3.15. - [Commits](https://github.com/qos-ch/logback/compare/v_1.3.12...v_1.3.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ipojo/handler/jmx/jmx-handler-it/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipojo/handler/jmx/jmx-handler-it/pom.xml b/ipojo/handler/jmx/jmx-handler-it/pom.xml index 616724d69f..8e3e385b47 100644 --- a/ipojo/handler/jmx/jmx-handler-it/pom.xml +++ b/ipojo/handler/jmx/jmx-handler-it/pom.xml @@ -109,7 +109,7 @@ ch.qos.logback logback-core - 1.3.12 + 1.3.15 test From d3397d0dbf0c59546c30d4bdb5a5bab93b4ead7c Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Wed, 5 Feb 2025 13:02:05 +0100 Subject: [PATCH 17/72] FELIX-6753 : Use only plugin path for redirect/form submit --- .../impl/HttpServicePlugin.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/http/webconsoleplugin/src/main/java/org/apache/felix/http/webconsoleplugin/impl/HttpServicePlugin.java b/http/webconsoleplugin/src/main/java/org/apache/felix/http/webconsoleplugin/impl/HttpServicePlugin.java index 4ae6de0765..21e9834b8d 100644 --- a/http/webconsoleplugin/src/main/java/org/apache/felix/http/webconsoleplugin/impl/HttpServicePlugin.java +++ b/http/webconsoleplugin/src/main/java/org/apache/felix/http/webconsoleplugin/impl/HttpServicePlugin.java @@ -88,10 +88,17 @@ private String getTestPath(final HttpServletRequest request) { return test; } + private String getRequestPath(final HttpServletRequest request) { + final int pos = request.getPathInfo().indexOf("/", 1); + return request.getContextPath() + .concat(request.getServletPath()) + .concat(pos == -1 ? request.getPathInfo() : request.getPathInfo().substring(0, pos)); + } + @Override protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { final String test = this.getTestPath(request); - final String path = request.getContextPath().concat(request.getServletPath()).concat(request.getPathInfo()); + final String path = this.getRequestPath(request); final String redirectTo = test == null ? path : path.concat("?").concat(ATTR_TEST).concat("=").concat(URLEncoder.encode(test, StandardCharsets.UTF_8)); response.sendRedirect(redirectTo); @@ -103,16 +110,13 @@ protected void doGet(final HttpServletRequest req, final HttpServletResponse res final PrintWriter pw = resp.getWriter(); - String path = req.getContextPath() + req.getServletPath(); - if ( req.getPathInfo() != null ) { - path = path + req.getPathInfo(); - } + final String path = this.getRequestPath(req); printForm(pw, this.getTestPath(req), path); printRuntimeDetails(pw, dto.serviceDTO); printPreprocessorDetails(pw, dto.preprocessorDTOs); - + for(final ServletContextDTO ctxDto : dto.servletContextDTOs ) { printContextDetails(pw, ctxDto); } @@ -211,7 +215,7 @@ private void printForm(final PrintWriter pw, final String value, final String pa appendBundleLink(sb, ref.getBundle().getBundleId(), ref.getBundle().getSymbolicName()); sb.append("\n"); } - + odd = this.printRow(pw, odd, "${Servlet}", sb.toString(), ""); } else { final StringBuilder sb = new StringBuilder(); @@ -225,7 +229,7 @@ private void printForm(final PrintWriter pw, final String value, final String pa appendBundleLink(sb, ref.getBundle().getBundleId(), ref.getBundle().getSymbolicName()); sb.append("\n"); } - + odd = this.printRow(pw, odd, "${Resource}", sb.toString(), ""); } } @@ -366,7 +370,7 @@ private boolean printRow(final PrintWriter pw, final boolean odd, final String.. final char type = text.charAt(pos + LINK_MARKER_START.length()); final int id = Integer.valueOf(text.substring(pos + LINK_MARKER_START.length() + 1, endPos)); final int tokenEndPos = text.indexOf(LINK_MARKER_END, pos); - final String linkTest = text.substring(endPos + 1, tokenEndPos); + final String linkTest = text.substring(endPos + 1, tokenEndPos); text = text.substring(0, pos) .concat(" Date: Sat, 8 Feb 2025 20:23:19 +0100 Subject: [PATCH 18/72] Update pom.xml --- http/samples/whiteboard/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/samples/whiteboard/pom.xml b/http/samples/whiteboard/pom.xml index c88b48d750..cd57e9cd71 100644 --- a/http/samples/whiteboard/pom.xml +++ b/http/samples/whiteboard/pom.xml @@ -39,7 +39,7 @@ - 12.1.0.alpha1 + 12.1.0.alpha2 From 5289a526894bf3345738ddb9915d4eef45c37fb5 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 8 Feb 2025 20:23:49 +0100 Subject: [PATCH 19/72] Update AbstractJettyTestSupport.java --- .../apache/felix/http/jetty/it/AbstractJettyTestSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index 6b16a5f34e..6a67f83914 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; public abstract class AbstractJettyTestSupport { - protected static final String JETTY_VERSION = "12.0.16"; + protected static final String JETTY_VERSION = "12.0.17"; protected final Logger logger = LoggerFactory.getLogger(getClass()); From bd5a37f92ae065c7fd1752654c4d74e7230d8d7a Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 9 Feb 2025 13:38:26 +0100 Subject: [PATCH 20/72] FELIX-6755 : Support Jakarta Servlet 6 --- http/bridge/README | 4 +- http/bridge/pom.xml | 14 +- http/proxy/pom.xml | 10 +- .../http/proxy/AbstractProxyServlet.java | 25 +-- .../felix/http/proxy/ProxyListener.java | 195 ------------------ .../{ => impl}/AbstractProxyListener.java | 15 +- .../proxy/{ => impl}/DispatcherTracker.java | 26 +-- .../impl/ProxyServletContextListener.java | 7 +- .../apache/felix/http/proxy/package-info.java | 24 --- 9 files changed, 37 insertions(+), 283 deletions(-) delete mode 100644 http/proxy/src/main/java/org/apache/felix/http/proxy/ProxyListener.java rename http/proxy/src/main/java/org/apache/felix/http/proxy/{ => impl}/AbstractProxyListener.java (97%) rename http/proxy/src/main/java/org/apache/felix/http/proxy/{ => impl}/DispatcherTracker.java (83%) delete mode 100644 http/proxy/src/main/java/org/apache/felix/http/proxy/package-info.java diff --git a/http/bridge/README b/http/bridge/README index 73352d34b5..b086c80d82 100644 --- a/http/bridge/README +++ b/http/bridge/README @@ -1 +1,3 @@ -This directory contains the implementation the Apache Felix Http Bridge. +This directory contains the implementation of the Apache Felix Http Bridge. + +It requires Jakarta Servlet 6. diff --git a/http/bridge/pom.xml b/http/bridge/pom.xml index b259bc8bac..ebeb36f5d9 100644 --- a/http/bridge/pom.xml +++ b/http/bridge/pom.xml @@ -29,7 +29,7 @@ Apache Felix Http Bridge This is an implementation of the OSGi Servlet Service, the OSGi Http Service and the OSGi Http Whiteboard Specification used when run as a web application org.apache.felix.http.bridge - 5.1.9-SNAPSHOT + 6.0.0-SNAPSHOT bundle @@ -78,8 +78,8 @@ org.apache.commons.* - jakarta.servlet;version="[5.0,7)", - jakarta.servlet.http;version="[5.0,7)", + jakarta.servlet, + jakarta.servlet.http, org.osgi.service.useradmin;resolution:=optional;version="[1.1,2)", sun.misc;resolution:=optional, sun.nio.ch;resolution:=optional, @@ -108,12 +108,14 @@ bundle + light-bundle @@ -146,7 +148,7 @@ jakarta.servlet jakarta.servlet-api - 5.0.0 + 6.0.0 org.osgi @@ -184,12 +186,12 @@ org.apache.felix org.apache.felix.http.base - 5.1.8 + 5.1.10 org.apache.felix org.apache.felix.http.wrappers - 1.0.2 + 1.1.8 diff --git a/http/proxy/pom.xml b/http/proxy/pom.xml index c0798add2d..c0e6d3e6d0 100644 --- a/http/proxy/pom.xml +++ b/http/proxy/pom.xml @@ -6,9 +6,9 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -28,7 +28,7 @@ Apache Felix Http Proxy org.apache.felix.http.proxy - 4.0.1-SNAPSHOT + 6.0.0-SNAPSHOT jar @@ -64,7 +64,7 @@ ${project.artifactId} ${project.version} - + @@ -80,7 +80,7 @@ jakarta.servlet jakarta.servlet-api - 5.0.0 + 6.0.0 provided diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java index 4440d24190..9bd42de107 100755 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java @@ -42,6 +42,7 @@ import jakarta.servlet.http.HttpServletRequestWrapper; import jakarta.servlet.http.HttpServletResponse; +import org.apache.felix.http.proxy.impl.DispatcherTracker; import org.osgi.framework.BundleContext; public abstract class AbstractProxyServlet @@ -242,31 +243,11 @@ public RequestDispatcher getNamedDispatcher(String name) { return delegatee.getNamedDispatcher(name); } - @Override - public Servlet getServlet(String name) throws ServletException { - return delegatee.getServlet(name); - } - - @Override - public Enumeration getServlets() { - return delegatee.getServlets(); - } - - @Override - public Enumeration getServletNames() { - return delegatee.getServletNames(); - } - @Override public void log(String msg) { delegatee.log(msg); } - @Override - public void log(Exception exception, String msg) { - delegatee.log(exception, msg); - } - @Override public void log(String message, Throwable throwable) { delegatee.log(message, throwable); @@ -477,7 +458,7 @@ public String getResponseCharacterEncoding() { @Override public void setResponseCharacterEncoding(String encoding) { - delegatee.setResponseCharacterEncoding(encoding); - } + delegatee.setResponseCharacterEncoding(encoding); + } } } diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/ProxyListener.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/ProxyListener.java deleted file mode 100644 index 4107da00d3..0000000000 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/ProxyListener.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.felix.http.proxy; - -import jakarta.servlet.ServletContext; -import jakarta.servlet.ServletContextEvent; -import jakarta.servlet.ServletContextListener; -import jakarta.servlet.http.HttpSessionAttributeListener; -import jakarta.servlet.http.HttpSessionBindingEvent; -import jakarta.servlet.http.HttpSessionEvent; -import jakarta.servlet.http.HttpSessionIdListener; -import jakarta.servlet.http.HttpSessionListener; - -import org.apache.felix.http.proxy.impl.EventDispatcherTracker; -import org.apache.felix.http.proxy.impl.ProxyServletContextListener; -import org.osgi.framework.BundleContext; -import org.osgi.framework.InvalidSyntaxException; - -/** - * The ProxyListener implements a Servlet API listener for HTTP - * Session related events. These events are provided by the servlet container - * and forwarded to the event dispatcher. - * - * @since 2.1.0 - * @deprecated Use the {@link ProxyServletContextListener} instead. - */ -@Deprecated -public class ProxyListener - implements HttpSessionAttributeListener, - HttpSessionListener, - HttpSessionIdListener, - ServletContextListener -{ - - private volatile ServletContext servletContext; - - private volatile EventDispatcherTracker eventDispatcherTracker; - - // ---------- ServletContextListener - - @Override - public void contextInitialized(final ServletContextEvent sce) - { - this.servletContext = sce.getServletContext(); - } - - @Override - public void contextDestroyed(final ServletContextEvent sce) - { - if (this.eventDispatcherTracker != null) - { - this.eventDispatcherTracker.close(); - this.eventDispatcherTracker = null; - } - this.servletContext = null; - } - - // ---------- HttpSessionListener - - @Override - public void sessionCreated(final HttpSessionEvent se) - { - final HttpSessionListener sessionDispatcher = getSessionDispatcher(); - if (sessionDispatcher != null) - { - sessionDispatcher.sessionCreated(se); - } - } - - @Override - public void sessionDestroyed(final HttpSessionEvent se) - { - final HttpSessionListener sessionDispatcher = getSessionDispatcher(); - if (sessionDispatcher != null) - { - sessionDispatcher.sessionDestroyed(se); - } - } - - // ---------- HttpSessionIdListener - - @Override - public void sessionIdChanged(final HttpSessionEvent event, final String oldSessionId) - { - final HttpSessionIdListener sessionIdDispatcher = getSessionIdDispatcher(); - if (sessionIdDispatcher != null) - { - sessionIdDispatcher.sessionIdChanged(event, oldSessionId); - } - } - - // ---------- HttpSessionAttributeListener - - @Override - public void attributeAdded(final HttpSessionBindingEvent se) - { - final HttpSessionAttributeListener attributeDispatcher = getAttributeDispatcher(); - if (attributeDispatcher != null) - { - attributeDispatcher.attributeAdded(se); - } - } - - @Override - public void attributeRemoved(final HttpSessionBindingEvent se) - { - final HttpSessionAttributeListener attributeDispatcher = getAttributeDispatcher(); - if (attributeDispatcher != null) - { - attributeDispatcher.attributeRemoved(se); - } - } - - @Override - public void attributeReplaced(final HttpSessionBindingEvent se) - { - final HttpSessionAttributeListener attributeDispatcher = getAttributeDispatcher(); - if (attributeDispatcher != null) - { - attributeDispatcher.attributeReplaced(se); - } - } - - // ---------- internal - - private Object getDispatcher() - { - if (this.eventDispatcherTracker == null) - { - // the bundle context may or may not be already provided; - // if not we cannot access the dispatcher yet - Object bundleContextAttr = this.servletContext.getAttribute(BundleContext.class.getName()); - if (!(bundleContextAttr instanceof BundleContext)) - { - return null; - } - - try - { - BundleContext bundleContext = (BundleContext) bundleContextAttr; - this.eventDispatcherTracker = new EventDispatcherTracker(bundleContext); - this.eventDispatcherTracker.open(); - } - catch (InvalidSyntaxException e) - { - // not expected for our simple filter - } - - } - return this.eventDispatcherTracker.getService(); - } - - private HttpSessionListener getSessionDispatcher() - { - if (this.eventDispatcherTracker != null) - { - return this.eventDispatcherTracker.getHttpSessionListener(); - } - return null; - } - - private HttpSessionIdListener getSessionIdDispatcher() - { - if (this.eventDispatcherTracker != null) - { - return this.eventDispatcherTracker.getHttpSessionIdListener(); - } - return null; - } - - private HttpSessionAttributeListener getAttributeDispatcher() - { - if (this.eventDispatcherTracker != null) - { - return this.eventDispatcherTracker.getHttpSessionAttributeListener(); - } - return null; - } -} diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyListener.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/AbstractProxyListener.java similarity index 97% rename from http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyListener.java rename to http/proxy/src/main/java/org/apache/felix/http/proxy/impl/AbstractProxyListener.java index 55da666747..e7d9e88035 100755 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyListener.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/AbstractProxyListener.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.felix.http.proxy; +package org.apache.felix.http.proxy.impl; import jakarta.servlet.ServletContextAttributeEvent; import jakarta.servlet.ServletContextAttributeListener; @@ -26,7 +26,6 @@ import jakarta.servlet.http.HttpSessionIdListener; import jakarta.servlet.http.HttpSessionListener; -import org.apache.felix.http.proxy.impl.EventDispatcherTracker; import org.osgi.framework.BundleContext; /** @@ -44,7 +43,7 @@ public abstract class AbstractProxyListener { private static final String ATTR_BUNDLE_CONTEXT = BundleContext.class.getName(); - + // ---------- HttpSessionListener @Override @@ -112,7 +111,7 @@ public void attributeReplaced(final HttpSessionBindingEvent se) } // ServletContextAttributeListener - + @Override public void attributeAdded(final ServletContextAttributeEvent event) { @@ -140,15 +139,15 @@ public void attributeReplaced(final ServletContextAttributeEvent event) startTracking(event.getServletContext().getAttribute(event.getName())); } } - + // ---------- internal protected abstract EventDispatcherTracker getEventDispatcherTracker(); - + protected abstract void stopTracking(); - + protected abstract void startTracking(Object bundleContext); - + private HttpSessionListener getSessionDispatcher() { final EventDispatcherTracker eventDispatcherTracker = getEventDispatcherTracker(); diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/DispatcherTracker.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java similarity index 83% rename from http/proxy/src/main/java/org/apache/felix/http/proxy/DispatcherTracker.java rename to http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java index a053678273..7bd92c4397 100644 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/DispatcherTracker.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.felix.http.proxy; +package org.apache.felix.http.proxy.impl; import jakarta.servlet.ServletConfig; import jakarta.servlet.http.HttpServlet; @@ -25,14 +25,10 @@ import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; -/** - * @deprecated - */ -@Deprecated public final class DispatcherTracker - extends ServiceTracker + extends ServiceTracker { - final static String DEFAULT_FILTER = "(http.felix.dispatcher=*)"; + final static String DEFAULT_FILTER = "((http.felix.dispatcher=*)(" + Constants.OBJECTCLASS + "=" + HttpServlet.class.getName() + "))"; private final ServletConfig config; private HttpServlet dispatcher; @@ -50,23 +46,17 @@ public HttpServlet getDispatcher() } @Override - public Object addingService(ServiceReference ref) + public HttpServlet addingService(ServiceReference ref) { - Object service = super.addingService(ref); - if (service instanceof HttpServlet) { - setDispatcher((HttpServlet)service); - } - + HttpServlet service = super.addingService(ref); + setDispatcher(service); return service; } @Override - public void removedService(ServiceReference ref, Object service) + public void removedService(ServiceReference ref, HttpServlet service) { - if (service instanceof HttpServlet) { - setDispatcher(null); - } - + setDispatcher(null); super.removedService(ref, service); } diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/ProxyServletContextListener.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/ProxyServletContextListener.java index 0996d17801..7f8256bf38 100644 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/ProxyServletContextListener.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/ProxyServletContextListener.java @@ -23,7 +23,6 @@ import jakarta.servlet.ServletContextListener; import jakarta.servlet.annotation.WebListener; -import org.apache.felix.http.proxy.AbstractProxyListener; import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; @@ -52,17 +51,17 @@ public void contextInitialized(final ServletContextEvent sce) // add all required listeners this.servletContext.addListener(new AbstractProxyListener() { - + @Override protected void stopTracking() { ProxyServletContextListener.this.stopTracking(); } - + @Override protected void startTracking(final Object bundleContextAttr) { ProxyServletContextListener.this.startTracking(bundleContextAttr); } - + @Override protected EventDispatcherTracker getEventDispatcherTracker() { return eventDispatcherTracker; diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/package-info.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/package-info.java deleted file mode 100644 index 5526ddf23b..0000000000 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -@Version("4.0.0") -package org.apache.felix.http.proxy; - -import org.osgi.annotation.versioning.Version; - From 9d0f8c51a156659dd6ce83b218476773dc552f20 Mon Sep 17 00:00:00 2001 From: Stefan Weiser Date: Mon, 10 Feb 2025 14:46:41 +0100 Subject: [PATCH 21/72] Syntax error fix for default filter (#381) --- .../org/apache/felix/http/proxy/impl/DispatcherTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java index 7bd92c4397..1d7baf771e 100644 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java @@ -28,7 +28,7 @@ public final class DispatcherTracker extends ServiceTracker { - final static String DEFAULT_FILTER = "((http.felix.dispatcher=*)(" + Constants.OBJECTCLASS + "=" + HttpServlet.class.getName() + "))"; + final static String DEFAULT_FILTER = "(&(http.felix.dispatcher=*)(" + Constants.OBJECTCLASS + "=" + HttpServlet.class.getName() + "))"; private final ServletConfig config; private HttpServlet dispatcher; From e348a1bbc9b3b8a733e5b2a4a130434da2ae3f9d Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Mon, 10 Feb 2025 14:49:59 +0100 Subject: [PATCH 22/72] FELIX-6755 : Create filter directly --- .../felix/http/proxy/AbstractProxyServlet.java | 2 +- .../felix/http/proxy/impl/DispatcherTracker.java | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java index 9bd42de107..0d0a23f520 100755 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/AbstractProxyServlet.java @@ -90,7 +90,7 @@ public String getInitParameter(String name) { } }; } - this.tracker = new DispatcherTracker(getBundleContext(), null, config); + this.tracker = new DispatcherTracker(getBundleContext(), config); this.tracker.open(); } diff --git a/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java index 1d7baf771e..f0f1b99522 100644 --- a/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java +++ b/http/proxy/src/main/java/org/apache/felix/http/proxy/impl/DispatcherTracker.java @@ -21,7 +21,6 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; -import org.osgi.framework.Filter; import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; @@ -33,10 +32,10 @@ public final class DispatcherTracker private final ServletConfig config; private HttpServlet dispatcher; - public DispatcherTracker(BundleContext context, String filter, ServletConfig config) + public DispatcherTracker(BundleContext context, ServletConfig config) throws Exception { - super(context, createFilter(context, filter), null); + super(context, context.createFilter(DEFAULT_FILTER), null); this.config = config; } @@ -94,14 +93,4 @@ private void initDispatcher() log("Failed to initialize dispatcher", e); } } - - private static Filter createFilter(BundleContext context, String filter) - throws Exception - { - StringBuffer str = new StringBuffer(); - str.append("(&(").append(Constants.OBJECTCLASS).append("="); - str.append(HttpServlet.class.getName()).append(")"); - str.append(filter != null ? filter : DEFAULT_FILTER).append(")"); - return context.createFilter(str.toString()); - } } From 1ccdf4ab00451b321cc4f8b262e25e7329cf9bff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:18:25 +0100 Subject: [PATCH 23/72] Bump ch.qos.logback:logback-core (#380) Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.3.12 to 1.3.15. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.3.12...v_1.3.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ipojo/handler/whiteboard/whiteboard-handler-it/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipojo/handler/whiteboard/whiteboard-handler-it/pom.xml b/ipojo/handler/whiteboard/whiteboard-handler-it/pom.xml index 52d09b4b2a..206b947791 100644 --- a/ipojo/handler/whiteboard/whiteboard-handler-it/pom.xml +++ b/ipojo/handler/whiteboard/whiteboard-handler-it/pom.xml @@ -105,7 +105,7 @@ ch.qos.logback logback-core - 1.3.12 + 1.3.15 test From 8f738e27018b0a2ec58c89241ba0d583d3cb1d28 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 07:16:37 +0100 Subject: [PATCH 24/72] Bump org.apache.felix:org.apache.felix.webconsole (#382) Bumps org.apache.felix:org.apache.felix.webconsole from 4.0.0 to 4.9.10. --- updated-dependencies: - dependency-name: org.apache.felix:org.apache.felix.webconsole dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ipojo/distributions/ipojo-webconsole-quicktart/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipojo/distributions/ipojo-webconsole-quicktart/pom.xml b/ipojo/distributions/ipojo-webconsole-quicktart/pom.xml index 9d1c40c15a..f49d6e2303 100644 --- a/ipojo/distributions/ipojo-webconsole-quicktart/pom.xml +++ b/ipojo/distributions/ipojo-webconsole-quicktart/pom.xml @@ -71,7 +71,7 @@ org.apache.felix org.apache.felix.webconsole - 4.0.0 + 4.9.10 org.apache.felix From 985d21efb7e05f427edfc8f338fc7b0ba081dd0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 01:50:36 +0000 Subject: [PATCH 25/72] Bump actions/upload-artifact from 4.6.0 to 4.6.1 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.0 to 4.6.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08...4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/maven-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index e328bf94dc..ffed9f23ca 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -67,7 +67,7 @@ jobs: run: mvn -B -V -Dstyle.color=always --file webconsole/pom.xml clean install verify - name: Upload Test Results if: always() - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 with: name: test-results if-no-files-found: warn From 57182f8d1431b3093a7b4f22f42456e85a5ed5de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 06:10:47 +0000 Subject: [PATCH 26/72] Bump ch.qos.logback:logback-core in /ipojo/runtime/composite-it Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.3.12 to 1.3.15. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.3.12...v_1.3.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- ipojo/runtime/composite-it/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipojo/runtime/composite-it/pom.xml b/ipojo/runtime/composite-it/pom.xml index 69eb9c3d00..31ed7c8157 100644 --- a/ipojo/runtime/composite-it/pom.xml +++ b/ipojo/runtime/composite-it/pom.xml @@ -159,7 +159,7 @@ ch.qos.logback logback-core - 1.3.12 + 1.3.15 test From 5a10c78f9619b51e44f5ffb9384fdf80d91b06e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 06:10:49 +0000 Subject: [PATCH 27/72] Bump org.apache.felix:org.apache.felix.webconsole Bumps org.apache.felix:org.apache.felix.webconsole from 4.9.0 to 4.9.10. --- updated-dependencies: - dependency-name: org.apache.felix:org.apache.felix.webconsole dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- webconsole-plugins/packageadmin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webconsole-plugins/packageadmin/pom.xml b/webconsole-plugins/packageadmin/pom.xml index 3da52db9b3..4eebdc51d3 100644 --- a/webconsole-plugins/packageadmin/pom.xml +++ b/webconsole-plugins/packageadmin/pom.xml @@ -139,7 +139,7 @@ org.apache.felix org.apache.felix.webconsole - 4.9.0 + 4.9.10 provided From 6418523e96cd5b26894fe5c1faddf88eaa3ecc91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:17:01 +0000 Subject: [PATCH 28/72] Bump org.apache.felix:org.apache.felix.webconsole Bumps org.apache.felix:org.apache.felix.webconsole from 4.9.0 to 4.9.10. --- updated-dependencies: - dependency-name: org.apache.felix:org.apache.felix.webconsole dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- webconsole-plugins/ds/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webconsole-plugins/ds/pom.xml b/webconsole-plugins/ds/pom.xml index f718b98d8a..a1c1feb1c3 100644 --- a/webconsole-plugins/ds/pom.xml +++ b/webconsole-plugins/ds/pom.xml @@ -126,7 +126,7 @@ org.apache.felix org.apache.felix.webconsole - 4.9.0 + 4.9.10 provided From 3efb001eaf21a7b78a40e7d61a50278d7f74bda7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:17:04 +0000 Subject: [PATCH 29/72] Bump ch.qos.logback:logback-core Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.3.12 to 1.3.15. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.3.12...v_1.3.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- ipojo/handler/temporal/temporal-dependency-handler-it/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipojo/handler/temporal/temporal-dependency-handler-it/pom.xml b/ipojo/handler/temporal/temporal-dependency-handler-it/pom.xml index 926725847a..0118fc101e 100644 --- a/ipojo/handler/temporal/temporal-dependency-handler-it/pom.xml +++ b/ipojo/handler/temporal/temporal-dependency-handler-it/pom.xml @@ -110,7 +110,7 @@ ch.qos.logback logback-core - 1.3.12 + 1.3.15 test From d14688ad6cbb478a16c5ef57f1777d3942fdbe71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Thu, 6 Mar 2025 09:22:20 +0100 Subject: [PATCH 30/72] FELIX-6754-Update-jetty-to-12.0.17 - Add JETTY_11 to list of possible enums that require setting `setDecodeAmbiguousURIs`, see https://github.com/jetty/jetty.project/pull/12827 --- .../org/apache/felix/http/jetty/internal/JettyService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java index 7cebcf0b4f..0c75d534da 100644 --- a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java +++ b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java @@ -16,6 +16,7 @@ */ package org.apache.felix.http.jetty.internal; +import static org.eclipse.jetty.http.UriCompliance.JETTY_11; import static org.eclipse.jetty.http.UriCompliance.LEGACY; import static org.eclipse.jetty.http.UriCompliance.UNAMBIGUOUS; import static org.eclipse.jetty.http.UriCompliance.UNSAFE; @@ -716,7 +717,8 @@ private void configureHttpConnectionFactory(HttpConnectionFactory connFactory) UriCompliance compliance = UriCompliance.valueOf(uriComplianceMode); config.setUriCompliance(compliance); - if (LEGACY.equals(compliance) || UNSAFE.equals(compliance) || UNAMBIGUOUS.equals(compliance)) { + if (LEGACY.equals(compliance) || UNSAFE.equals(compliance) || + UNAMBIGUOUS.equals(compliance) || JETTY_11.equals(compliance)) { // See https://github.com/jetty/jetty.project/issues/11448#issuecomment-1969206031 this.server.getContainedBeans(ServletHandler.class) .forEach(handler -> handler.setDecodeAmbiguousURIs(true)); From c14bc5b24be4e80e092d3a9282d89935a28fb293 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Mar 2025 08:42:24 +0000 Subject: [PATCH 31/72] Bump ch.qos.logback:logback-core from 1.3.12 to 1.3.15 in /rootcause Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.3.12 to 1.3.15. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.3.12...v_1.3.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- rootcause/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootcause/pom.xml b/rootcause/pom.xml index 323c994bf3..e28bdd6272 100644 --- a/rootcause/pom.xml +++ b/rootcause/pom.xml @@ -170,7 +170,7 @@ ch.qos.logback logback-core - 1.3.12 + 1.3.15 test From 064578beafc984047acf653eb6f274c5214ce6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Fri, 7 Mar 2025 14:07:42 +0100 Subject: [PATCH 32/72] [maven-release-plugin] prepare release org.apache.felix.http.jetty12-1.0.22 --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 265841a47b..8ea0383aac 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -37,7 +37,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty12-1.0.10 + org.apache.felix.http.jetty12-1.0.22 From cf805847aa34b9068c322882a1cdeb1bd2e02701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Fri, 7 Mar 2025 14:07:50 +0100 Subject: [PATCH 33/72] [maven-release-plugin] prepare for next development iteration --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 8ea0383aac..265841a47b 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -37,7 +37,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty12-1.0.22 + org.apache.felix.http.jetty12-1.0.10 From 1733285a7d0a3adb605fe6dfeb0ad954a49721a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:08:36 +0000 Subject: [PATCH 34/72] Bump ch.qos.logback:logback-core from 1.3.12 to 1.3.15 in /systemready Bumps [ch.qos.logback:logback-core](https://github.com/qos-ch/logback) from 1.3.12 to 1.3.15. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.3.12...v_1.3.15) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-core dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- systemready/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemready/pom.xml b/systemready/pom.xml index d1f15138ae..fcfb894f0b 100644 --- a/systemready/pom.xml +++ b/systemready/pom.xml @@ -214,7 +214,7 @@ ch.qos.logback logback-core - 1.3.12 + 1.3.15 test From 6139eb2274996e92644ea28e96af532ad1fd937c Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 9 Mar 2025 10:21:54 +0100 Subject: [PATCH 35/72] [maven-release-plugin] prepare release org.apache.felix.http.webconsoleplugin-1.2.2 --- http/webconsoleplugin/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/webconsoleplugin/pom.xml b/http/webconsoleplugin/pom.xml index 452200c2bb..3fcda3f8ee 100644 --- a/http/webconsoleplugin/pom.xml +++ b/http/webconsoleplugin/pom.xml @@ -28,14 +28,14 @@ Apache Felix Http Webconsole Plugin org.apache.felix.http.webconsoleplugin - 1.2.1-SNAPSHOT + 1.2.2 bundle scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - HEAD + org.apache.felix.http.webconsoleplugin-1.2.2 From 23b5e857c23dbb0cfcd326ec0e82d6d29fc25356 Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 9 Mar 2025 10:25:16 +0100 Subject: [PATCH 36/72] [maven-release-plugin] prepare for next development iteration --- http/webconsoleplugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/webconsoleplugin/pom.xml b/http/webconsoleplugin/pom.xml index 3fcda3f8ee..4088020cf7 100644 --- a/http/webconsoleplugin/pom.xml +++ b/http/webconsoleplugin/pom.xml @@ -28,7 +28,7 @@ Apache Felix Http Webconsole Plugin org.apache.felix.http.webconsoleplugin - 1.2.2 + 1.2.3-SNAPSHOT bundle From 23b75ce0e971fc9561f03763de15b7f5ea5e553c Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Sun, 9 Mar 2025 11:14:47 +0100 Subject: [PATCH 37/72] FELIX-6757 : Properly encode bundle information --- .../internal/core/BundlesServlet.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java index fde9fcffb0..93ba3a2538 100644 --- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java +++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java @@ -77,6 +77,7 @@ import org.osgi.service.packageadmin.PackageAdmin; import org.osgi.util.tracker.ServiceTracker; import org.osgi.util.tracker.ServiceTrackerCustomizer; +import org.owasp.encoder.Encode; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; @@ -137,14 +138,14 @@ public class BundlesServlet extends AbstractOsgiManagerPlugin implements Invento private ServiceRegistration bipCapabilitiesRequired; /** - * Default constructor + * Default constructor * @throws IOException If template can't be read */ public BundlesServlet() throws IOException { // load templates TEMPLATE_MAIN = readTemplateFile( "/templates/bundles.html" ); } - + @Override protected String getCategory() { return CATEGORY_OSGI; @@ -170,24 +171,24 @@ public void activate( BundleContext bundleContext ) { super.activate( bundleContext ); bundleInfoTracker = new ServiceTracker<>( bundleContext, BundleInfoProvider.class, new ServiceTrackerCustomizer() { - + @Override public BundleInfoProvider addingService(ServiceReference reference) { return bundleContext.getService(reference); } - + @Override public void modifiedService(ServiceReference reference, BundleInfoProvider service) { // nothing to do } - + @Override public void removedService(ServiceReference reference, BundleInfoProvider service) { try { bundleContext.ungetService(reference); } catch ( final IllegalStateException ise) { // might happen on shutdown, ignore - } + } } }); bundleInfoTracker.open(); @@ -762,7 +763,11 @@ private void keyVal(final List> props, final String key, fin { final Map obj = new LinkedHashMap(); obj.put("key", key); - obj.put("value", val); + if ( val instanceof String ) { + obj.put("value", Encode.forJavaScript((String)val)); + } else { + obj.put("value", val); + } props.add(obj); } } From 68be2bd2863e834846cb70d9ceb1ddb200348fe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 08:52:10 +0100 Subject: [PATCH 38/72] FELIX-6756 Cookie name "Path" is a reserved token - Apply fix from patch - Add unit tests --- .../http/jakartawrappers/CookieWrapper.java | 68 ++++++++++++------ .../http/javaxwrappers/CookieWrapper.java | 70 +++++++++++++------ .../jakartawrappers/CookieWrapperTest.java | 44 ++++++++++++ .../http/javaxwrappers/CookieWrapperTest.java | 44 ++++++++++++ 4 files changed, 186 insertions(+), 40 deletions(-) create mode 100644 http/wrappers/src/test/java/org/apache/felix/http/jakartawrappers/CookieWrapperTest.java create mode 100644 http/wrappers/src/test/java/org/apache/felix/http/javaxwrappers/CookieWrapperTest.java diff --git a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/CookieWrapper.java b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/CookieWrapper.java index 9c85fdeb51..55f9416c90 100644 --- a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/CookieWrapper.java +++ b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/CookieWrapper.java @@ -50,64 +50,92 @@ public static Cookie[] wrap(final javax.servlet.http.Cookie[] array) { * @param c Wrapped cookie */ public CookieWrapper(@NotNull final javax.servlet.http.Cookie c) { - super(c.getName(), c.getValue()); + super("dummy", "dummy"); this.cookie = c; - super.setComment(c.getComment()); - if ( c.getDomain() != null ) { - super.setDomain(c.getDomain()); - } - super.setHttpOnly(c.isHttpOnly()); - super.setMaxAge(c.getMaxAge()); - super.setPath(c.getPath()); - super.setSecure(c.getSecure()); - super.setVersion(c.getVersion()); + } + + @Override + public String getName() { + return this.cookie.getName(); + } + + @Override + public String getValue() { + return this.cookie.getValue(); + } + + @Override + public void setValue(String value) { + this.cookie.setValue(value); } @Override public void setComment(final String purpose) { this.cookie.setComment(purpose); - super.setComment(purpose); + } + + @Override + public String getComment() { + return this.cookie.getComment(); } @Override public void setDomain(final String domain) { this.cookie.setDomain(domain); - super.setDomain(domain); + } + + @Override + public String getDomain() { + return this.cookie.getDomain(); } @Override public void setMaxAge(final int expiry) { this.cookie.setMaxAge(expiry); - super.setMaxAge(expiry); + } + + @Override + public int getMaxAge() { + return this.cookie.getMaxAge(); } @Override public void setPath(final String uri) { this.cookie.setPath(uri); - super.setPath(uri); + } + + @Override + public String getPath() { + return this.cookie.getPath(); } @Override public void setSecure(final boolean flag) { this.cookie.setSecure(flag); - super.setSecure(flag); } @Override - public void setValue(final String newValue) { - this.cookie.setValue(newValue); - super.setValue(newValue); + public boolean getSecure() { + return this.cookie.getSecure(); } @Override public void setVersion(final int v) { this.cookie.setVersion(v); - super.setVersion(v); + } + + @Override + public int getVersion() { + return this.cookie.getVersion(); } @Override public void setHttpOnly(final boolean isHttpOnly) { this.cookie.setHttpOnly(isHttpOnly); - super.setHttpOnly(isHttpOnly); + } + + @Override + public boolean isHttpOnly() { + return this.cookie.isHttpOnly(); } } diff --git a/http/wrappers/src/main/java/org/apache/felix/http/javaxwrappers/CookieWrapper.java b/http/wrappers/src/main/java/org/apache/felix/http/javaxwrappers/CookieWrapper.java index 7c8bcd79c8..856f8b45b6 100644 --- a/http/wrappers/src/main/java/org/apache/felix/http/javaxwrappers/CookieWrapper.java +++ b/http/wrappers/src/main/java/org/apache/felix/http/javaxwrappers/CookieWrapper.java @@ -47,67 +47,97 @@ public static javax.servlet.http.Cookie[] wrap(final Cookie[] array) { /** * Create new cookie + * * @param c Wrapped cookie */ public CookieWrapper(@NotNull final Cookie c) { - super(c.getName(), c.getValue()); + super("dummy", "dummy"); this.cookie = c; - super.setComment(c.getComment()); - if ( c.getDomain() != null ) { - super.setDomain(c.getDomain()); - } - super.setHttpOnly(c.isHttpOnly()); - super.setMaxAge(c.getMaxAge()); - super.setPath(c.getPath()); - super.setSecure(c.getSecure()); - super.setVersion(c.getVersion()); + } + + @Override + public String getName() { + return this.cookie.getName(); + } + + @Override + public String getValue() { + return this.cookie.getValue(); + } + + @Override + public void setValue(String value) { + this.cookie.setValue(value); } @Override public void setComment(final String purpose) { this.cookie.setComment(purpose); - super.setComment(purpose); + } + + @Override + public String getComment() { + return this.cookie.getComment(); } @Override public void setDomain(final String domain) { this.cookie.setDomain(domain); - super.setDomain(domain); + } + + @Override + public String getDomain() { + return this.cookie.getDomain(); } @Override public void setMaxAge(final int expiry) { this.cookie.setMaxAge(expiry); - super.setMaxAge(expiry); + } + + @Override + public int getMaxAge() { + return this.cookie.getMaxAge(); } @Override public void setPath(final String uri) { this.cookie.setPath(uri); - super.setPath(uri); + } + + @Override + public String getPath() { + return this.cookie.getPath(); } @Override public void setSecure(final boolean flag) { this.cookie.setSecure(flag); - super.setSecure(flag); } @Override - public void setValue(final String newValue) { - this.cookie.setValue(newValue); - super.setValue(newValue); + public boolean getSecure() { + return this.cookie.getSecure(); } @Override public void setVersion(final int v) { this.cookie.setVersion(v); - super.setVersion(v); + } + + @Override + public int getVersion() { + return this.cookie.getVersion(); } @Override public void setHttpOnly(final boolean isHttpOnly) { this.cookie.setHttpOnly(isHttpOnly); - super.setHttpOnly(isHttpOnly); } + + @Override + public boolean isHttpOnly() { + return this.cookie.isHttpOnly(); + } + } diff --git a/http/wrappers/src/test/java/org/apache/felix/http/jakartawrappers/CookieWrapperTest.java b/http/wrappers/src/test/java/org/apache/felix/http/jakartawrappers/CookieWrapperTest.java new file mode 100644 index 0000000000..0bb6334767 --- /dev/null +++ b/http/wrappers/src/test/java/org/apache/felix/http/jakartawrappers/CookieWrapperTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.felix.http.jakartawrappers; + +import javax.servlet.http.Cookie; + +import org.junit.Test; +import org.mockito.Mockito; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +public class CookieWrapperTest { + @Test + public void testReservedCookieNames() { + testCookie("Path"); + testCookie("MaxAge"); + testCookie("Comment"); + } + + private static void testCookie(String cookieName) { + Cookie pathCookie = Mockito.mock(Cookie.class); + when(pathCookie.getName()).thenReturn(cookieName); + + // Threw `java.lang.IllegalArgumentException: Cookie name "Path" is a reserved token` before + CookieWrapper cookieWrapper = new CookieWrapper(pathCookie); + + assertEquals(cookieName, cookieWrapper.getName()); + } +} diff --git a/http/wrappers/src/test/java/org/apache/felix/http/javaxwrappers/CookieWrapperTest.java b/http/wrappers/src/test/java/org/apache/felix/http/javaxwrappers/CookieWrapperTest.java new file mode 100644 index 0000000000..cea5110a62 --- /dev/null +++ b/http/wrappers/src/test/java/org/apache/felix/http/javaxwrappers/CookieWrapperTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.felix.http.javaxwrappers; + +import jakarta.servlet.http.Cookie; + +import org.junit.Test; +import org.mockito.Mockito; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +public class CookieWrapperTest { + @Test + public void testReservedCookieNames() { + testCookie("Path"); + testCookie("MaxAge"); + testCookie("Comment"); + } + + private static void testCookie(String cookieName) { + Cookie pathCookie = Mockito.mock(Cookie.class); + when(pathCookie.getName()).thenReturn(cookieName); + + // Threw `java.lang.IllegalArgumentException: Cookie name "Path" is a reserved token` before + CookieWrapper cookieWrapper = new CookieWrapper(pathCookie); + + assertEquals(cookieName, cookieWrapper.getName()); + } +} From 1760dc2e5bbcb6aedbb3714e17339003a9dfb367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 08:53:49 +0100 Subject: [PATCH 39/72] Revert "FELIX-6754-Update-jetty-to-12.0.17" This reverts commit 264bd75701284b923653f613b570e72f08af9824. JETTY_11 was mistakenly added to the list of enums that require setting `setDecodeAmbiguousURIs`. This commit reverts this behavior. --- .../org/apache/felix/http/jetty/internal/JettyService.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java index 0c75d534da..7cebcf0b4f 100644 --- a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java +++ b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyService.java @@ -16,7 +16,6 @@ */ package org.apache.felix.http.jetty.internal; -import static org.eclipse.jetty.http.UriCompliance.JETTY_11; import static org.eclipse.jetty.http.UriCompliance.LEGACY; import static org.eclipse.jetty.http.UriCompliance.UNAMBIGUOUS; import static org.eclipse.jetty.http.UriCompliance.UNSAFE; @@ -717,8 +716,7 @@ private void configureHttpConnectionFactory(HttpConnectionFactory connFactory) UriCompliance compliance = UriCompliance.valueOf(uriComplianceMode); config.setUriCompliance(compliance); - if (LEGACY.equals(compliance) || UNSAFE.equals(compliance) || - UNAMBIGUOUS.equals(compliance) || JETTY_11.equals(compliance)) { + if (LEGACY.equals(compliance) || UNSAFE.equals(compliance) || UNAMBIGUOUS.equals(compliance)) { // See https://github.com/jetty/jetty.project/issues/11448#issuecomment-1969206031 this.server.getContainedBeans(ServletHandler.class) .forEach(handler -> handler.setDecodeAmbiguousURIs(true)); From 97c924369611a7c5d404606d4c16419aa6ce7ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:45:13 +0100 Subject: [PATCH 40/72] [maven-release-plugin] prepare release org.apache.felix.http.wrappers-1.1.10 --- http/wrappers/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/wrappers/pom.xml b/http/wrappers/pom.xml index 26f7845667..7e0d39b23f 100644 --- a/http/wrappers/pom.xml +++ b/http/wrappers/pom.xml @@ -35,7 +35,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - HEAD + org.apache.felix.http.wrappers-1.1.10 From e96c656991075d8c320968768089bc812ca352ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:45:18 +0100 Subject: [PATCH 41/72] [maven-release-plugin] prepare for next development iteration --- http/wrappers/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/wrappers/pom.xml b/http/wrappers/pom.xml index 7e0d39b23f..26f7845667 100644 --- a/http/wrappers/pom.xml +++ b/http/wrappers/pom.xml @@ -35,7 +35,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.wrappers-1.1.10 + HEAD From b469cbe5c7f5738d3cb4698fede80d00e89ac854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:47:04 +0100 Subject: [PATCH 42/72] FELIX-6756 Cookie name "Path" is a reserved token - Use wrappers snapshot in jetty bundle --- http/jetty/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index 166c8a67d1..970835016d 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -499,7 +499,7 @@ org.apache.felix org.apache.felix.http.wrappers - 1.0.6 + 1.0.7-SNAPSHOT commons-fileupload From 3cb8ba003b71bec1253add967e5ab252b6353361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:50:43 +0100 Subject: [PATCH 43/72] [maven-release-plugin] prepare release org.apache.felix.http.jetty-5.1.30 --- http/jetty/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index 970835016d..e6fe9e95a7 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -30,14 +30,14 @@ This is an implementation of the R8.1 OSGi Servlet Service, the R7 OSGi Http Service and the R7 OSGi Http Whiteboard Specification org.apache.felix.http.jetty - 5.1.29-SNAPSHOT + 5.1.30 bundle scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - HEAD + org.apache.felix.http.jetty-5.1.30 @@ -499,7 +499,7 @@ org.apache.felix org.apache.felix.http.wrappers - 1.0.7-SNAPSHOT + 1.0.8 commons-fileupload From 333102e0305390924f88257aa8bee1e402311b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:50:48 +0100 Subject: [PATCH 44/72] [maven-release-plugin] prepare for next development iteration --- http/jetty/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index e6fe9e95a7..dd305110be 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -30,14 +30,14 @@ This is an implementation of the R8.1 OSGi Servlet Service, the R7 OSGi Http Service and the R7 OSGi Http Whiteboard Specification org.apache.felix.http.jetty - 5.1.30 + 5.1.31-SNAPSHOT bundle scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty-5.1.30 + HEAD From 11ae5d14ace2b07a4ad65ab7f6a7f0538e98e0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:55:06 +0100 Subject: [PATCH 45/72] [maven-release-plugin] prepare release org.apache.felix.http.jetty12-1.0.24 --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 265841a47b..f7c832a683 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -37,7 +37,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty12-1.0.10 + org.apache.felix.http.jetty12-1.0.24 From 588884616b189d419994f222f3263f32e2816256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 10:55:11 +0100 Subject: [PATCH 46/72] [maven-release-plugin] prepare for next development iteration --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index f7c832a683..265841a47b 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -37,7 +37,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty12-1.0.24 + org.apache.felix.http.jetty12-1.0.10 From 55e8b11bd223d1843ba57fabe64c3c48e94a9aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 11:13:55 +0100 Subject: [PATCH 47/72] FELIX-6756 Cookie name "Path" is a reserved token - Use wrappers snapshot in jetty bundle --- http/jetty/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index dd305110be..52fc25fa2a 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -499,7 +499,7 @@ org.apache.felix org.apache.felix.http.wrappers - 1.0.8 + 1.0.7-SNAPSHOT commons-fileupload From 22456391a54086f016916c86eebb3cf24ad60344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 10 Mar 2025 11:35:15 +0100 Subject: [PATCH 48/72] FELIX-6756 Cookie name "Path" is a reserved token - build wrappers before jetty bundles, so the jetty12 can depend on latest snapshot versions. - jetty11 bundle still needs to rely on previous snapshot version until after the release is done. --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 96c95ea35d..c9cedcce46 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -44,12 +44,12 @@ inventoryprinter itest servlet-api + wrappers jetty jetty12 proxy samples/whiteboard sslfilter webconsoleplugin - wrappers From 68b2ddaa86ca0ea7fbc1e23d4207587fed6a9e8e Mon Sep 17 00:00:00 2001 From: Carsten Ziegeler Date: Thu, 13 Mar 2025 16:33:55 +0100 Subject: [PATCH 49/72] Update README.md --- webconsole/README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/webconsole/README.md b/webconsole/README.md index 37be9038f4..2f492d2a02 100644 --- a/webconsole/README.md +++ b/webconsole/README.md @@ -113,6 +113,37 @@ In this case the Configuration Manager displays the name "myRealm, myClass" as d ## Releases +### Changes in 5.0.10 (5/Feb/25) + +#### Bug + +- [FELIX-6747](https://issues.apache.org/jira/browse/FELIX-6747) : NPE in activator of webconsole +- [FELIX-6751](https://issues.apache.org/jira/browse/FELIX-6751) : Use proper encoding for service filter + + +### Changes in 5.0.8 (19/Sep/24) + +#### Bug + +- [FELIX-6727](https://issues.apache.org/jira/browse/FELIX-6727) : NullPointerException when using REST API to install a bundle + + +### Changes in 5.0.6 (10/Jul/24) + +#### Bug + +- [FELIX-6715](https://issues.apache.org/jira/browse/FELIX-6715) : Incorrect link in "Using bundles" for /system/console/services/ + + +### Changes in 5.0.4 (20/Jun/24) + +#### Improvements + +- [FELIX-6712](https://issues.apache.org/jira/browse/FELIX-6712) : Release Websonsole - without JSON License +#### Docs + +- [FELIX-6703]()https://issues.apache.org/jira/browse/FELIX-6703 : Missing conf properties in the documentation + ### Changes in 5.0.2 (14/Apr/24) #### Bug @@ -135,7 +166,18 @@ In this case the Configuration Manager displays the name "myRealm, myClass" as d - [FELIX-6654](https://issues.apache.org/jira/browse/FELIX-6654) : Remove support for commons fileupload -### Changes in 4.9.8 (14/Apr/24) #### Bug - [FELIX-6688](https://issues.apache.org/jira/browse/FELIX-6688) : Context path of outer servlet container is not respected for authentication +### Changes in 4.9.10 (5/Feb/25) + +#### Bug + +- [FELIX-6747](https://issues.apache.org/jira/browse/FELIX-6747) : NPE in activator of webconsole +- [FELIX-6751](https://issues.apache.org/jira/browse/FELIX-6751) : Use proper encoding for service filter + + +### Changes in 4.9.8 (14/Apr/24) +#### Bug + +- [FELIX-6688](https://issues.apache.org/jira/browse/FELIX-6688) : Context path of outer servlet container is not respected for authentication ### Changes in 4.9.6 (7/Oct/23) From ef80790319db1a2b5ea5769ac292d59e241c9bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Thu, 13 Mar 2025 09:06:30 +0100 Subject: [PATCH 50/72] FELIX-6758 Update to Jetty 12.0.18 / 11.0.25 - Upgrade to 12.0.18 and 11.0.25 --- http/jetty/pom.xml | 2 +- .../apache/felix/http/jetty/it/AbstractJettyTestSupport.java | 2 +- .../apache/felix/http/jetty/it/AbstractJettyTestSupport.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index 52fc25fa2a..beb6e28503 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -42,7 +42,7 @@ 11 - 11.0.24 + 11.0.25 true 4.13.3 diff --git a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index 849677c8c1..8ca81650d6 100644 --- a/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; public abstract class AbstractJettyTestSupport { - protected static final String JETTY_VERSION = "11.0.24"; + protected static final String JETTY_VERSION = "11.0.25"; protected final Logger logger = LoggerFactory.getLogger(getClass()); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index 6a67f83914..f0050d05c7 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; public abstract class AbstractJettyTestSupport { - protected static final String JETTY_VERSION = "12.0.17"; + protected static final String JETTY_VERSION = "12.0.18"; protected final Logger logger = LoggerFactory.getLogger(getClass()); From 00673dca487f5ce18a4b266b82ad243fb582646e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 21:51:47 +0000 Subject: [PATCH 51/72] Bump org.apache.felix:org.apache.felix.webconsole Bumps org.apache.felix:org.apache.felix.webconsole from 4.9.0 to 4.9.10. --- updated-dependencies: - dependency-name: org.apache.felix:org.apache.felix.webconsole dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- webconsole-plugins/obr/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webconsole-plugins/obr/pom.xml b/webconsole-plugins/obr/pom.xml index b22e2b9cb1..09990b9bb1 100644 --- a/webconsole-plugins/obr/pom.xml +++ b/webconsole-plugins/obr/pom.xml @@ -129,7 +129,7 @@ org.apache.felix org.apache.felix.webconsole - 4.9.0 + 4.9.10 provided From ffca48aceac852f688df7be8d6738ba2dd3c99ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Tue, 18 Mar 2025 11:15:39 +0100 Subject: [PATCH 52/72] [maven-release-plugin] prepare release org.apache.felix.http.jetty-5.1.32 --- http/jetty/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index beb6e28503..20684c8f28 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -30,14 +30,14 @@ This is an implementation of the R8.1 OSGi Servlet Service, the R7 OSGi Http Service and the R7 OSGi Http Whiteboard Specification org.apache.felix.http.jetty - 5.1.31-SNAPSHOT + 5.1.32 bundle scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - HEAD + org.apache.felix.http.jetty-5.1.32 @@ -499,7 +499,7 @@ org.apache.felix org.apache.felix.http.wrappers - 1.0.7-SNAPSHOT + 1.0.8 commons-fileupload From 0c5e99072334d7c8effbd560536e2e338487a6a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Tue, 18 Mar 2025 11:15:44 +0100 Subject: [PATCH 53/72] [maven-release-plugin] prepare for next development iteration --- http/jetty/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index 20684c8f28..a0cb2b8256 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -30,14 +30,14 @@ This is an implementation of the R8.1 OSGi Servlet Service, the R7 OSGi Http Service and the R7 OSGi Http Whiteboard Specification org.apache.felix.http.jetty - 5.1.32 + 5.1.33-SNAPSHOT bundle scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty-5.1.32 + HEAD From 296118e8db7ab6aabbb98a52c55387c90c5cd71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Tue, 18 Mar 2025 11:20:21 +0100 Subject: [PATCH 54/72] [maven-release-plugin] prepare release org.apache.felix.http.jetty12-1.0.26 --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index 265841a47b..b6d16b1768 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -37,7 +37,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty12-1.0.10 + org.apache.felix.http.jetty12-1.0.26 From d886012674b773840cdfedefb7ab7c2e2ea79b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Tue, 18 Mar 2025 11:20:26 +0100 Subject: [PATCH 55/72] [maven-release-plugin] prepare for next development iteration --- http/jetty12/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index b6d16b1768..265841a47b 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -37,7 +37,7 @@ scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git https://gitbox.apache.org/repos/asf?p=felix-dev.git - org.apache.felix.http.jetty12-1.0.26 + org.apache.felix.http.jetty12-1.0.10 From 72078f80f153eb60ce34706ee0f1b3451a8e9a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Wed, 19 Mar 2025 08:09:45 +0100 Subject: [PATCH 56/72] FELIX-6750-Jetty-12.1.0-tryout - update to 12.1.0.alpha2 --- .../apache/felix/http/jetty/it/AbstractJettyTestSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index f0050d05c7..8013828af9 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -45,7 +45,7 @@ import org.slf4j.LoggerFactory; public abstract class AbstractJettyTestSupport { - protected static final String JETTY_VERSION = "12.0.18"; + protected static final String JETTY_VERSION = "12.1.0.alpha2"; protected final Logger logger = LoggerFactory.getLogger(getClass()); From 35918d8ffae7c64fc36243cb39623157e49484ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Wed, 19 Mar 2025 08:24:53 +0100 Subject: [PATCH 57/72] FELIX-6750-Jetty-12.1.0-tryout - update to latest snapshot for jetty bundle --- http/itest/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/itest/pom.xml b/http/itest/pom.xml index a2951dde0f..2173b8b4da 100644 --- a/http/itest/pom.xml +++ b/http/itest/pom.xml @@ -33,7 +33,7 @@ 11 2.1.0 - 5.1.29-SNAPSHOT + 5.1.33-SNAPSHOT org.apache.felix.http.jetty 4.13.1 2.6.14 From 2c33badebde00287c9fd6de4a28d2d2675f07bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:05:44 +0200 Subject: [PATCH 58/72] FELIX-6750-Jetty-12.1.0-tryout - revert unneeded changes now 6.1.0 already contains the 6.1 changes of the servlet api --- .../felix/http/jetty/it/AbstractJettyTestSupport.java | 2 +- http/servlet-api/pom.xml | 11 +---------- http/wrappers/pom.xml | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index abc55cb585..2505d4bead 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -76,7 +76,7 @@ public Option[] configuration() throws IOException { // update pax logging for SLF4J 2 mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version("2.3.0"), optionalRemoteDebug(), - mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("3.1.0-SNAPSHOT"), + mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.servlet-api").version("6.1.0"), testBundle("bundle.filename"), junitBundles(), awaitility(), diff --git a/http/servlet-api/pom.xml b/http/servlet-api/pom.xml index f8c1c7548b..9829bbb64d 100644 --- a/http/servlet-api/pom.xml +++ b/http/servlet-api/pom.xml @@ -21,14 +21,9 @@ Apache Felix Servlet API Provides the Servlet API for use by applications org.apache.felix.http.servlet-api - 3.1.0-SNAPSHOT + >6.1.1-SNAPSHOT bundle - - - true - - scm:git:https://github.com/apache/felix-dev.git scm:git:https://github.com/apache/felix-dev.git @@ -110,10 +105,6 @@ jakarta.servlet.annotation;version=5.0;uses:="jakarta.servlet", jakarta.servlet.descriptor;version=5.0, jakarta.servlet.http;version=5.0;uses:="jakarta.servlet", - jakarta.servlet;version=6.0;uses:="jakarta.servlet.annotation,jakarta.servlet.descriptor", - jakarta.servlet.annotation;version=6.0;uses:="jakarta.servlet", - jakarta.servlet.descriptor;version=6.0, - jakarta.servlet.http;version=6.0;uses:="jakarta.servlet", jakarta.servlet;version=6.1;uses:="jakarta.servlet.annotation,jakarta.servlet.descriptor", jakarta.servlet.annotation;version=6.1;uses:="jakarta.servlet", jakarta.servlet.descriptor;version=6.1, diff --git a/http/wrappers/pom.xml b/http/wrappers/pom.xml index bed754c6ac..db06e0a73c 100644 --- a/http/wrappers/pom.xml +++ b/http/wrappers/pom.xml @@ -28,7 +28,7 @@ Apache Felix Http Wrappers org.apache.felix.http.wrappers - 1.2.0-SNAPSHOT + 6.1.0 bundle From 25360cd4edf41827ea0dc907a0512a7de9c9aded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:07:33 +0200 Subject: [PATCH 59/72] FELIX-6750-Jetty-12.1.0-tryout - revert unneeded changes now 6.1.0 already contains the 6.1 changes of the servlet api --- http/base/pom.xml | 2 +- http/jetty12/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/http/base/pom.xml b/http/base/pom.xml index 646cfb9470..d32e90fad9 100644 --- a/http/base/pom.xml +++ b/http/base/pom.xml @@ -28,7 +28,7 @@ Apache Felix Http Base org.apache.felix.http.base - 6.0.0-SNAPSHOT + 5.1.15-SNAPSHOT jar diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index d16af35a25..d2f7fcd857 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -740,12 +740,12 @@ org.apache.felix org.apache.felix.http.base - 6.0.0-SNAPSHOT + 5.1.15-SNAPSHOT org.apache.felix org.apache.felix.http.wrappers - 1.2.0-SNAPSHOT + 6.1.0 commons-fileupload From 093cfbb43051161643c88677d2c083b7cc0fd472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:08:49 +0200 Subject: [PATCH 60/72] FELIX-6750-Jetty-12.1.0-tryout - revert unneeded changes now 6.1.0 already contains the 6.1 changes of the servlet api --- http/README.md | 2 +- http/itest/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/http/README.md b/http/README.md index 4a7f641552..256632ff25 100644 --- a/http/README.md +++ b/http/README.md @@ -15,7 +15,7 @@ This is an implementation of the [R8.1 Whiteboard Specification for Jakarta Serv The Apache Felix HTTP Service project includes several bundles. - * [`org.apache.felix.http.servlet-api`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.servlet-api) - Provides the Servlet API (versions 2.6, 3.0, 3.1, 4.0, 5.0, 6.0 (3.0.0) and 6.1 (since 3.1.0) of the Servlet specification) + * [`org.apache.felix.http.servlet-api`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.servlet-api) - Provides the Servlet API (versions 2.6, 3.0, 3.1, 4.0, 5.0, 6.0 and 6.1 of the Servlet specification) * [`org.apache.felix.http.api`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.api) - Provides the OSGi APIs for the Http Whiteboard and Http Service. * [`org.apache.felix.http.jetty12`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty12) - Implementation that is embedding Jetty server (currently Jetty 12.1.x, requiring Java 17). This bundle includes the http.api bundle. It's the the preferred Felix Jetty bundle to use, as Jetty 11 will be [EoL in 2025](https://github.com/jetty/jetty.project/issues/10485). * [`org.apache.felix.http.jetty`](https://mvnrepository.com/artifact/org.apache.felix/org.apache.felix.http.jetty) - Predecessor implementation that is embedding Jetty server (currently Jetty 11.x, requiring Java 11). This bundle includes the http.api bundle. diff --git a/http/itest/pom.xml b/http/itest/pom.xml index 12c1b1b632..367d529c93 100644 --- a/http/itest/pom.xml +++ b/http/itest/pom.xml @@ -44,7 +44,7 @@ jetty12 17 - 3.1.0-SNAPSHOT + 6.1.0 1.1.0-SNAPSHOT org.apache.felix.http.jetty12 From 8b297ce319df41800f182fc9ccd22450f2ff4d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:09:33 +0200 Subject: [PATCH 61/72] FELIX-6750-Jetty-12.1.0-tryout - revert unneeded changes now 6.1.0 already contains the 6.1 changes of the servlet api --- http/jetty/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/jetty/pom.xml b/http/jetty/pom.xml index a2506d024e..4c2afde05c 100644 --- a/http/jetty/pom.xml +++ b/http/jetty/pom.xml @@ -499,7 +499,7 @@ org.apache.felix org.apache.felix.http.base - 6.0.0-SNAPSHOT + 5.1.15-SNAPSHOT org.apache.felix From d0d0cfc941c44b1645de834fde9e928c225796cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:10:41 +0200 Subject: [PATCH 62/72] FELIX-6750-Jetty-12.1.0-tryout - revert unneeded changes now 6.1.0 already contains the 6.1 changes of the servlet api --- http/wrappers/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/wrappers/pom.xml b/http/wrappers/pom.xml index db06e0a73c..ddf2d83727 100644 --- a/http/wrappers/pom.xml +++ b/http/wrappers/pom.xml @@ -28,7 +28,7 @@ Apache Felix Http Wrappers org.apache.felix.http.wrappers - 6.1.0 + 6.1.1-SNAPSHOT bundle From 8e47a8f70b6d7f16f07009b666ebdf07c49dabb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:36:13 +0200 Subject: [PATCH 63/72] FELIX-6750-Jetty-12.1.0-tryout - Fix version --- http/servlet-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/servlet-api/pom.xml b/http/servlet-api/pom.xml index 9829bbb64d..0a42af74be 100644 --- a/http/servlet-api/pom.xml +++ b/http/servlet-api/pom.xml @@ -21,7 +21,7 @@ Apache Felix Servlet API Provides the Servlet API for use by applications org.apache.felix.http.servlet-api - >6.1.1-SNAPSHOT + 6.1.1-SNAPSHOT bundle From 416202ce54be1709e5829f704de16c6af1ae2eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 11:47:38 +0200 Subject: [PATCH 64/72] FELIX-6750-Jetty-12.1.0-tryout - Fix merge - Move to EE11 for ErrorHandler - Use try with resources --- .../jetty/internal/JettyErrorHandler.java | 2 +- .../http/jetty/it/JettyMaxFormSizeIT.java | 33 +++++++-------- .../jetty/it/JettySizeLimitHandlerIT.java | 40 +++++++++---------- .../it/JettyUriComplianceModeDefaultIT.java | 39 +++++++++--------- .../it/JettyUriComplianceModeLegacyIT.java | 29 ++++++-------- .../http/jetty/it/JettyVirtualThreadsIT.java | 19 ++++----- .../HttpServletResponseWrapper.java | 7 ---- 7 files changed, 74 insertions(+), 95 deletions(-) diff --git a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyErrorHandler.java b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyErrorHandler.java index 1a6c82bb7e..9fdfbda0de 100644 --- a/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyErrorHandler.java +++ b/http/jetty12/src/main/java/org/apache/felix/http/jetty/internal/JettyErrorHandler.java @@ -18,7 +18,7 @@ import java.util.Map; -import org.eclipse.jetty.ee10.servlet.ErrorHandler; +import org.eclipse.jetty.ee11.servlet.ErrorHandler; import org.eclipse.jetty.http.HttpFields.Mutable; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.Response; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java index a0e71667ff..bc000f76b6 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java @@ -95,29 +95,26 @@ public void setup(){ @Test public void testFormSizeLimit() throws Exception { HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - HttpClient httpClient = new HttpClient(transport); - httpClient.start(); + try (HttpClient httpClient = new HttpClient(transport)) { + Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); + int httpPort = Integer.parseInt((String) value); - Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); - int httpPort = Integer.parseInt((String) value); + URI uri = new URI(String.format("http://localhost:%d/endpoint", httpPort)); - URI uri = new URI(String.format("http://localhost:%d/endpoint", httpPort)); + Fields formFields = new Fields(); + formFields.add(new Fields.Field("key", "value")); // under 10 bytes + ContentResponse response = httpClient.FORM(uri, formFields); - Fields formFields = new Fields(); - formFields.add(new Fields.Field("key", "value")); // under 10 bytes - ContentResponse response = httpClient.FORM(uri, formFields); + assertEquals(200, response.getStatus()); + assertEquals("OK", response.getContentAsString()); - assertEquals(200, response.getStatus()); - assertEquals("OK", response.getContentAsString()); + Fields formFieldsLimitExceeded = new Fields(); + formFieldsLimitExceeded.add(new Fields.Field("key", "valueoverlimit")); // over limit of 10 bytes + ContentResponse responseExceeded = httpClient.FORM(uri, formFieldsLimitExceeded); - Fields formFieldsLimitExceeded = new Fields(); - formFieldsLimitExceeded.add(new Fields.Field("key", "valueoverlimit")); // over limit of 10 bytes - ContentResponse responseExceeded = httpClient.FORM(uri, formFieldsLimitExceeded); - - // HTTP 500 thrown, because req.getParameter("key") throws an IOException - assertEquals(500, responseExceeded.getStatus()); - - httpClient.close(); + // HTTP 500 thrown, because req.getParameter("key") throws an IOException + assertEquals(500, responseExceeded.getStatus()); + } } static final class HelloWorldServlet extends HttpServlet { diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index 179726bf9b..8afa72dab2 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -98,33 +98,31 @@ public void setup(){ @Test public void testRequestResponseLimits() throws Exception { HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - HttpClient httpClient = new HttpClient(transport); - httpClient.start(); + try (HttpClient httpClient = new HttpClient(transport)) { + Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); + int httpPort = Integer.parseInt((String) value); - Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); - int httpPort = Integer.parseInt((String) value); + Fields formFields = new Fields(); + formFields.add(new Fields.Field("key","value")); // under 10 bytes + ContentResponse responseWithinLimit = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFields); - Fields formFields = new Fields(); - formFields.add(new Fields.Field("key", "value")); // under 10 bytes - ContentResponse responseWithinLimit = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFields); + // Request limit ok, response limit ok + assertEquals(200, responseWithinLimit.getStatus()); + assertEquals("OK", responseWithinLimit.getContentAsString()); - // Request limit ok, response limit ok - assertEquals(200, responseWithinLimit.getStatus()); - assertEquals("OK", responseWithinLimit.getContentAsString()); + // Request limit ok, response limit exceeded + // org.eclipse.jetty.http.HttpException$RuntimeException: 500: Response body is too large: 17>10 + ContentResponse responseExceedingLimit = httpClient.FORM(new URI(String.format("http://localhost:%d/exceedinglimit/a", httpPort)), formFields); - // Request limit ok, response limit exceeded - // org.eclipse.jetty.http.HttpException$RuntimeException: 500: Response body is too large: 17>10 - ContentResponse responseExceedingLimit = httpClient.FORM(new URI(String.format("http://localhost:%d/exceedinglimit/a", httpPort)), formFields); - assertEquals(500, responseExceedingLimit.getStatus()); + assertEquals(500, responseExceedingLimit.getStatus()); - Fields formFieldsLimitExceeded = new Fields(); - formFieldsLimitExceeded.add(new Fields.Field("key", "valueoverlimit")); // over limit of 10 bytes - ContentResponse responseExceeded = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFieldsLimitExceeded); + Fields formFieldsLimitExceeded = new Fields(); + formFieldsLimitExceeded.add(new Fields.Field("key","valueoverlimit")); // over limit of 10 bytes + ContentResponse responseExceeded = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFieldsLimitExceeded); - // Request limit exceeded, HTTP 413 directly from Jetty - assertEquals(413, responseExceeded.getStatus()); - - httpClient.close(); + // Request limit exceeded, HTTP 413 directly from Jetty + assertEquals(413, responseExceeded.getStatus()); + } } static final class HelloWorldServletWithinLimit extends HttpServlet { diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index fa0fd81a7c..e45722723b 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -92,32 +92,29 @@ public void setup(){ @Test public void testUriCompliance() throws Exception { HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - HttpClient httpClient = new HttpClient(transport); - httpClient.start(); + try (HttpClient httpClient = new HttpClient(transport)) { + Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); + int httpPort = Integer.parseInt((String) value); - Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); - int httpPort = Integer.parseInt((String) value); + URI destUriWorking = new URI(String.format("http://localhost:%d/endpoint/working", httpPort)); + URI destUriAmbigousPath = new URI("http://localhost:" + httpPort + "/endpoint/ambigousPathitem_0_http%3A%2F%2Fwww.test.com%2F0.html/abc"); - URI destUriWorking = new URI(String.format("http://localhost:%d/endpoint/working", httpPort)); - URI destUriAmbigousPath = new URI("http://localhost:" + httpPort + "/endpoint/ambigousPathitem_0_http%3A%2F%2Fwww.test.com%2F0.html/abc"); + ContentResponse response = httpClient.GET(destUriWorking); + assertEquals(200, response.getStatus()); + assertEquals("OK", response.getContentAsString()); - ContentResponse response = httpClient.GET(destUriWorking); - assertEquals(200, response.getStatus()); - assertEquals("OK", response.getContentAsString()); + // Validate custom headers in case of success page, should not be present + assertNull(response.getHeaders().get("Strict-Transport-Security")); + assertNull(response.getHeaders().get("X-Custom-Header")); - // Validate custom headers in case of success page, should not be present - assertNull(response.getHeaders().get("Strict-Transport-Security")); - assertNull(response.getHeaders().get("X-Custom-Header")); - - // blocked with HTTP 400 by default - // validate custom headers in case of error page - ContentResponse responseAmbiguousPath = httpClient.GET(destUriAmbigousPath); - assertEquals(400, responseAmbiguousPath.getStatus()); - assertEquals("max-age=31536000", responseAmbiguousPath.getHeaders().get("Strict-Transport-Security")); - assertEquals("123", responseAmbiguousPath.getHeaders().get("X-Custom-Header")); - - httpClient.close(); + // blocked with HTTP 400 by default + // validate custom headers in case of error page + ContentResponse responseAmbiguousPath = httpClient.GET(destUriAmbigousPath); + assertEquals(400, responseAmbiguousPath.getStatus()); + assertEquals("max-age=31536000", responseAmbiguousPath.getHeaders().get("Strict-Transport-Security")); + assertEquals("123", responseAmbiguousPath.getHeaders().get("X-Custom-Header")); + } } static final class UriComplianceEndpoint extends HttpServlet { diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java index cd228e0271..2146fb61af 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java @@ -62,24 +62,21 @@ protected Option felixHttpConfig(int httpPort) { @Test public void testUriCompliance() throws Exception { HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - HttpClient httpClient = new HttpClient(transport); - httpClient.start(); + try (HttpClient httpClient = new HttpClient(transport)) { + Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); + int httpPort = Integer.parseInt((String) value); - Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); - int httpPort = Integer.parseInt((String) value); + URI destUriWorking = new URI(String.format("http://localhost:%d/endpoint/working", httpPort)); + URI destUriAmbigousPath = new URI("http://localhost:" + httpPort + "/endpoint/ambigousPathitem_0_http%3A%2F%2Fwww.test.com%2F0.html/abc"); - URI destUriWorking = new URI(String.format("http://localhost:%d/endpoint/working", httpPort)); - URI destUriAmbigousPath = new URI("http://localhost:" + httpPort + "/endpoint/ambigousPathitem_0_http%3A%2F%2Fwww.test.com%2F0.html/abc"); + ContentResponse response = httpClient.GET(destUriWorking); + assertEquals(200, response.getStatus()); + assertEquals("OK", response.getContentAsString()); - ContentResponse response = httpClient.GET(destUriWorking); - assertEquals(200, response.getStatus()); - assertEquals("OK", response.getContentAsString()); - - // no longer blocked due to LEGACY compliance mode - ContentResponse response2 = httpClient.GET(destUriAmbigousPath); - assertEquals(200, response2.getStatus()); - assertEquals("OK", response2.getContentAsString()); - - httpClient.close(); + // no longer blocked due to LEGACY compliance mode + ContentResponse response2 = httpClient.GET(destUriAmbigousPath); + assertEquals(200, response2.getStatus()); + assertEquals("OK", response2.getContentAsString()); + } } } \ No newline at end of file diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index 4c2baa46f7..50a784d432 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -96,19 +96,16 @@ public void testJettyRunningWithVirtualThreads() throws Exception { return; } HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - HttpClient httpClient = new HttpClient(transport); - httpClient.start(); + try (HttpClient httpClient = new HttpClient(transport)) { + Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); + int httpPort = Integer.parseInt((String) value); - Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); - int httpPort = Integer.parseInt((String) value); + URI destUri = new URI(String.format("http://localhost:%d/endpoint/working", httpPort)); - URI destUri = new URI(String.format("http://localhost:%d/endpoint/working", httpPort)); - - ContentResponse response = httpClient.GET(destUri); - assertEquals(200, response.getStatus()); - assertEquals("OK", response.getContentAsString()); - - httpClient.close(); + ContentResponse response = httpClient.GET(destUri); + assertEquals(200, response.getStatus()); + assertEquals("OK", response.getContentAsString()); + } } static final class ExampleEndpoint extends HttpServlet { diff --git a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java index 7ce825fcf2..ff974f0658 100644 --- a/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java +++ b/http/wrappers/src/main/java/org/apache/felix/http/jakartawrappers/HttpServletResponseWrapper.java @@ -89,13 +89,6 @@ public void sendRedirect(String location, int sc) throws IOException { this.response.sendRedirect(location); } - @Override - public void sendRedirect(String location, int sc, boolean clearBuffer) throws IOException { - this.response.setStatus(sc); - this.response.sendRedirect(location); - this.response.flushBuffer(); - } - @Override public void setDateHeader(final String name, final long date) { this.response.setDateHeader(name, date); From 9963f647eb071f43e2d6c6674e9a1accf53ddf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 12:23:30 +0200 Subject: [PATCH 65/72] FELIX-6750-Jetty-12.1.0-tryout - Move to EE11 for new tests - Simplify HTTP client migration --- .../http/base/internal/handler/WebSocketHandlerTest.java | 2 +- .../org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java | 7 +++---- .../felix/http/jetty/it/JettySizeLimitHandlerIT.java | 7 +++---- .../http/jetty/it/JettyUriComplianceModeDefaultIT.java | 3 +-- .../http/jetty/it/JettyUriComplianceModeLegacyIT.java | 3 +-- .../apache/felix/http/jetty/it/JettyVirtualThreadsIT.java | 3 +-- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/WebSocketHandlerTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/handler/WebSocketHandlerTest.java index e635a50f1d..3b7a39700f 100644 --- a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/WebSocketHandlerTest.java +++ b/http/base/src/test/java/org/apache/felix/http/base/internal/handler/WebSocketHandlerTest.java @@ -21,7 +21,7 @@ import static org.mockito.Mockito.mock; import org.apache.felix.http.javaxwrappers.ServletWrapper; -import org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServlet; +import org.eclipse.jetty.ee11.websocket.server.JettyWebSocketServlet; import org.junit.Before; import org.junit.Test; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java index bc000f76b6..bfee562414 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java @@ -64,9 +64,9 @@ protected Option[] additionalOptions() throws IOException { spifly(), // bundles for the server side - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), // additional bundles for the client side @@ -94,8 +94,7 @@ public void setup(){ @Test public void testFormSizeLimit() throws Exception { - HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - try (HttpClient httpClient = new HttpClient(transport)) { + try (HttpClient httpClient = new HttpClient()) { Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index 8afa72dab2..f17eba11ca 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -63,9 +63,9 @@ protected Option[] additionalOptions() throws IOException { spifly(), // bundles for the server side - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty.ee10").artifactId("jetty-ee10-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), // additional bundles for the client side @@ -97,8 +97,7 @@ public void setup(){ @Test public void testRequestResponseLimits() throws Exception { - HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - try (HttpClient httpClient = new HttpClient(transport)) { + try (HttpClient httpClient = new HttpClient()) { Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index e45722723b..22fece94e1 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -91,8 +91,7 @@ public void setup(){ @Test public void testUriCompliance() throws Exception { - HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - try (HttpClient httpClient = new HttpClient(transport)) { + try (HttpClient httpClient = new HttpClient()) { Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java index 2146fb61af..c715f7635b 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java @@ -61,8 +61,7 @@ protected Option felixHttpConfig(int httpPort) { @Test public void testUriCompliance() throws Exception { - HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - try (HttpClient httpClient = new HttpClient(transport)) { + try (HttpClient httpClient = new HttpClient()) { Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index 50a784d432..687f4a973a 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -95,8 +95,7 @@ public void testJettyRunningWithVirtualThreads() throws Exception { // This test only works on Java 21 or newer return; } - HttpClientTransportOverHTTP transport = new HttpClientTransportOverHTTP(); - try (HttpClient httpClient = new HttpClient(transport)) { + try (HttpClient httpClient = new HttpClient()) { Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); From a7901741340c0ef816932a5b2895f72cf14e3d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 12:25:00 +0200 Subject: [PATCH 66/72] FELIX-6750-Jetty-12.1.0-tryout - Organize imports --- http/base/pom.xml | 6 ++--- .../http/jetty/it/JettyMaxFormSizeIT.java | 1 - .../jetty/it/JettySizeLimitHandlerIT.java | 1 - .../it/JettyUriComplianceModeDefaultIT.java | 1 - .../it/JettyUriComplianceModeLegacyIT.java | 15 ------------- .../http/jetty/it/JettyVirtualThreadsIT.java | 1 - .../it/JettyVirtualThreadsThreadPoolIT.java | 22 ------------------- 7 files changed, 3 insertions(+), 44 deletions(-) diff --git a/http/base/pom.xml b/http/base/pom.xml index d32e90fad9..14c50c4d30 100644 --- a/http/base/pom.xml +++ b/http/base/pom.xml @@ -158,9 +158,9 @@ test - org.eclipse.jetty.ee10.websocket - jetty-ee10-websocket-jetty-server - 12.0.21 + org.eclipse.jetty.ee11.websocket + jetty-ee11-websocket-jetty-server + 12.1.0.beta0 test diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java index bfee562414..21e16b4d88 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java @@ -35,7 +35,6 @@ import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; import org.eclipse.jetty.util.Fields; import org.junit.Before; import org.junit.Test; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index f17eba11ca..e7b177b32f 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -35,7 +35,6 @@ import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; import org.eclipse.jetty.util.Fields; import org.junit.Before; import org.junit.Test; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index 22fece94e1..2bbce37afb 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -35,7 +35,6 @@ import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java index c715f7635b..dcaf1c5f25 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java @@ -18,34 +18,19 @@ import static org.eclipse.jetty.http.UriCompliance.LEGACY; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration; -import java.io.IOException; import java.net.URI; -import java.util.Hashtable; -import java.util.Map; - -import javax.inject.Inject; -import jakarta.servlet.Servlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; -import org.eclipse.jetty.http.UriCompliance; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.BundleContext; import org.osgi.service.http.HttpService; -import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants; @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index 687f4a973a..7698605217 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -34,7 +34,6 @@ import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsThreadPoolIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsThreadPoolIT.java index e22a2b775a..7b4d19cdfb 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsThreadPoolIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsThreadPoolIT.java @@ -16,35 +16,13 @@ */ package org.apache.felix.http.jetty.it; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.cm.ConfigurationAdminOptions.newConfiguration; -import java.io.IOException; -import java.net.URI; -import java.util.Hashtable; -import java.util.Map; - -import javax.inject.Inject; -import jakarta.servlet.Servlet; -import jakarta.servlet.http.HttpServlet; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; - -import org.eclipse.jetty.client.ContentResponse; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP; -import org.junit.Before; -import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Option; import org.ops4j.pax.exam.junit.PaxExam; import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy; import org.ops4j.pax.exam.spi.reactors.PerClass; -import org.osgi.framework.BundleContext; -import org.osgi.service.http.HttpService; -import org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants; @RunWith(PaxExam.class) @ExamReactorStrategy(PerClass.class) From 1dccc80ff300c3eb32012dc0f9f8b8d6de0c0538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 12:37:38 +0200 Subject: [PATCH 67/72] FELIX-6750-Jetty-12.1.0-tryout - Call start - Handle java.nio.channels.AsynchronousCloseException with a FIXME, might be a Jetty bug? --- .../felix/http/jetty/it/JettyMaxFormSizeIT.java | 1 + .../http/jetty/it/JettySizeLimitHandlerIT.java | 14 +++++++++++--- .../jetty/it/JettyUriComplianceModeDefaultIT.java | 1 + .../jetty/it/JettyUriComplianceModeLegacyIT.java | 1 + .../felix/http/jetty/it/JettyVirtualThreadsIT.java | 1 + 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java index 21e16b4d88..3160aa6eef 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java @@ -94,6 +94,7 @@ public void setup(){ @Test public void testFormSizeLimit() throws Exception { try (HttpClient httpClient = new HttpClient()) { + httpClient.start(); Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index e7b177b32f..391d5c0821 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -25,6 +25,7 @@ import java.net.URI; import java.util.Hashtable; import java.util.Map; +import java.util.concurrent.ExecutionException; import javax.inject.Inject; import jakarta.servlet.Servlet; @@ -97,6 +98,7 @@ public void setup(){ @Test public void testRequestResponseLimits() throws Exception { try (HttpClient httpClient = new HttpClient()) { + httpClient.start(); Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); @@ -116,10 +118,16 @@ public void testRequestResponseLimits() throws Exception { Fields formFieldsLimitExceeded = new Fields(); formFieldsLimitExceeded.add(new Fields.Field("key","valueoverlimit")); // over limit of 10 bytes - ContentResponse responseExceeded = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFieldsLimitExceeded); - // Request limit exceeded, HTTP 413 directly from Jetty - assertEquals(413, responseExceeded.getStatus()); + try { + ContentResponse responseExceeded = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFieldsLimitExceeded); + + // Request limit exceeded, HTTP 413 directly from Jetty + assertEquals(413, responseExceeded.getStatus()); + } catch (ExecutionException e) { + // FIXME this shouldn't happen, but it does with Jetty 12.1.0.beta0 + // java.nio.channels.AsynchronousCloseException + } } } diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index 2bbce37afb..9c6e957cf8 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -91,6 +91,7 @@ public void setup(){ @Test public void testUriCompliance() throws Exception { try (HttpClient httpClient = new HttpClient()) { + httpClient.start(); Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java index dcaf1c5f25..8b2944bc5d 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeLegacyIT.java @@ -47,6 +47,7 @@ protected Option felixHttpConfig(int httpPort) { @Test public void testUriCompliance() throws Exception { try (HttpClient httpClient = new HttpClient()) { + httpClient.start(); Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index 7698605217..0acc5c79dd 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -95,6 +95,7 @@ public void testJettyRunningWithVirtualThreads() throws Exception { return; } try (HttpClient httpClient = new HttpClient()) { + httpClient.start(); Object value = bundleContext.getServiceReference(HttpService.class).getProperty("org.osgi.service.http.port"); int httpPort = Integer.parseInt((String) value); From 8719de512b2edd03c19d4dced5ba509e37fc4845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 12:48:03 +0200 Subject: [PATCH 68/72] FELIX-6750-Jetty-12.1.0-tryout - Fix FIXME, handle async with future --- .../http/jetty/it/JettySizeLimitHandlerIT.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index 391d5c0821..c992d6a8bd 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -25,6 +25,7 @@ import java.net.URI; import java.util.Hashtable; import java.util.Map; +import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import javax.inject.Inject; @@ -34,8 +35,11 @@ import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; +import org.eclipse.jetty.client.CompletableResponseListener; import org.eclipse.jetty.client.ContentResponse; +import org.eclipse.jetty.client.FormRequestContent; import org.eclipse.jetty.client.HttpClient; +import org.eclipse.jetty.client.Request; import org.eclipse.jetty.util.Fields; import org.junit.Before; import org.junit.Test; @@ -119,15 +123,12 @@ public void testRequestResponseLimits() throws Exception { Fields formFieldsLimitExceeded = new Fields(); formFieldsLimitExceeded.add(new Fields.Field("key","valueoverlimit")); // over limit of 10 bytes - try { - ContentResponse responseExceeded = httpClient.FORM(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort)), formFieldsLimitExceeded); + Request request = httpClient.newRequest(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort))) + .body(new FormRequestContent(formFieldsLimitExceeded)); - // Request limit exceeded, HTTP 413 directly from Jetty - assertEquals(413, responseExceeded.getStatus()); - } catch (ExecutionException e) { - // FIXME this shouldn't happen, but it does with Jetty 12.1.0.beta0 - // java.nio.channels.AsynchronousCloseException - } + CompletableFuture completable = new CompletableResponseListener(request).send(); + ContentResponse response = completable.get(); + assertEquals(413, response.getStatus()); } } From dc7b9886392af0a21f5c283fcf48f783cfcdbf4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 26 May 2025 14:08:49 +0200 Subject: [PATCH 69/72] FELIX-6750-Jetty-12.1.0-tryout - Reset FIXME, AsynchronousCloseException still happens --- .../felix/http/jetty/it/JettySizeLimitHandlerIT.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index c992d6a8bd..f5ec67892a 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -126,9 +126,14 @@ public void testRequestResponseLimits() throws Exception { Request request = httpClient.newRequest(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort))) .body(new FormRequestContent(formFieldsLimitExceeded)); - CompletableFuture completable = new CompletableResponseListener(request).send(); - ContentResponse response = completable.get(); - assertEquals(413, response.getStatus()); + try { + CompletableFuture completable = new CompletableResponseListener(request).send(); + ContentResponse response = completable.get(); + assertEquals(413, response.getStatus()); + } catch (ExecutionException e) { + // FIXME this shouldn't happen, but it does with Jetty 12.1.0.beta0 + // java.nio.channels.AsynchronousCloseException + } } } From 51cbc8e71376af49dc3528063da72bd45e652793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Fri, 20 Jun 2025 11:43:56 +0200 Subject: [PATCH 70/72] Move to 12.1.0.beta1 --- http/base/pom.xml | 2 +- http/jetty12/pom.xml | 2 +- .../apache/felix/http/jetty/it/AbstractJettyTestSupport.java | 2 +- .../org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java | 2 +- http/samples/whiteboard/pom.xml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/http/base/pom.xml b/http/base/pom.xml index 14c50c4d30..1405e24484 100644 --- a/http/base/pom.xml +++ b/http/base/pom.xml @@ -160,7 +160,7 @@ org.eclipse.jetty.ee11.websocket jetty-ee11-websocket-jetty-server - 12.1.0.beta0 + 12.1.0.beta1 test diff --git a/http/jetty12/pom.xml b/http/jetty12/pom.xml index d2f7fcd857..5aa3f050c6 100644 --- a/http/jetty12/pom.xml +++ b/http/jetty12/pom.xml @@ -42,7 +42,7 @@ 17 - 12.1.0.beta0 + 12.1.0.beta1 true 4.13.3 diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java index 2505d4bead..51874f2089 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/AbstractJettyTestSupport.java @@ -43,7 +43,7 @@ import org.ops4j.pax.exam.util.PathUtils; public abstract class AbstractJettyTestSupport { - protected static final String JETTY_VERSION = "12.1.0.beta0"; + protected static final String JETTY_VERSION = "12.1.0.beta1"; private final String workingDirectory = String.format("%s/target/paxexam/%s/%s", PathUtils.getBaseDir(), getClass().getSimpleName(), UUID.randomUUID()); diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index f5ec67892a..2eb12c69fb 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -131,7 +131,7 @@ public void testRequestResponseLimits() throws Exception { ContentResponse response = completable.get(); assertEquals(413, response.getStatus()); } catch (ExecutionException e) { - // FIXME this shouldn't happen, but it does with Jetty 12.1.0.beta0 + // FIXME this shouldn't happen, but it does with Jetty 12.1.0.beta1 // java.nio.channels.AsynchronousCloseException } } diff --git a/http/samples/whiteboard/pom.xml b/http/samples/whiteboard/pom.xml index 37c316e695..547d70860a 100644 --- a/http/samples/whiteboard/pom.xml +++ b/http/samples/whiteboard/pom.xml @@ -39,7 +39,7 @@ - 12.1.0.beta0 + 12.1.0.beta1 From 67dbb41c531b9e18ee50007e7a151075d61629f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 21 Jul 2025 10:10:30 +0200 Subject: [PATCH 71/72] - Fix beta2 dependencies and add spifly to light classifier test - Remove jetty-ee --- .../felix/http/jetty/it/JakartaSpecificWebsocketIT.java | 1 - .../org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java | 1 - .../apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java | 1 - .../felix/http/jetty/it/JettySpecificWebsocketIT.java | 1 - .../http/jetty/it/JettyUriComplianceModeDefaultIT.java | 1 - .../apache/felix/http/jetty/it/JettyVirtualThreadsIT.java | 1 - .../org/apache/felix/http/jetty/it/LightClassifierIT.java | 6 +++++- 7 files changed, 5 insertions(+), 7 deletions(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java index f1e7458044..1df344f2d9 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JakartaSpecificWebsocketIT.java @@ -76,7 +76,6 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-client").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-gzip").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("jetty-websocket-core-client").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java index 3160aa6eef..b193661c78 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyMaxFormSizeIT.java @@ -64,7 +64,6 @@ protected Option[] additionalOptions() throws IOException { // bundles for the server side mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index 2eb12c69fb..4c67254ca6 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -68,7 +68,6 @@ protected Option[] additionalOptions() throws IOException { // bundles for the server side mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java index 5cbf8e3f65..9e8d75d08f 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySpecificWebsocketIT.java @@ -89,7 +89,6 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11.websocket").artifactId("jetty-ee11-websocket-jetty-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), // additional bundles for the client side diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java index 9c6e957cf8..5d90217097 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyUriComplianceModeDefaultIT.java @@ -60,7 +60,6 @@ protected Option[] additionalOptions() throws IOException { // bundles for the server side mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java index 0acc5c79dd..d18958c642 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettyVirtualThreadsIT.java @@ -60,7 +60,6 @@ protected Option[] additionalOptions() throws IOException { // bundles for the server side mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.compression").artifactId("jetty-compression-common").version(jettyVersion), diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java index 6a018830e8..2891823454 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/LightClassifierIT.java @@ -53,6 +53,8 @@ public class LightClassifierIT extends AbstractJettyTestSupport { protected Option[] additionalOptions() throws IOException { String jettyVersion = System.getProperty("jetty.version", JETTY_VERSION); return new Option[] { + spifly(), + // Minimum additional jetty dependency bundles mavenBundle().groupId("commons-io").artifactId("commons-io").version("2.19.0"), mavenBundle().groupId("commons-fileupload").artifactId("commons-fileupload").version("1.6.0"), @@ -68,8 +70,10 @@ protected Option[] additionalOptions() throws IOException { mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-server").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-session").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-servlet").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee11").artifactId("jetty-ee11-webapp").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty.ee").artifactId("jetty-ee-webapp").version(jettyVersion), mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-util").version(jettyVersion), - mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-ee").version(jettyVersion), + mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-xml").version(jettyVersion), // additional dependencies to verify FELIX-6700 mavenBundle().groupId("org.owasp.encoder").artifactId("encoder").version("1.2.3"), From 4f69f6839a6a74007d8f59e1b01f69405886c8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Mon, 21 Jul 2025 10:13:39 +0200 Subject: [PATCH 72/72] - Remove try/catch which is fixed in beta2 --- .../felix/http/jetty/it/JettySizeLimitHandlerIT.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java index 4c67254ca6..6da37832df 100644 --- a/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java +++ b/http/jetty12/src/test/java/org/apache/felix/http/jetty/it/JettySizeLimitHandlerIT.java @@ -125,14 +125,9 @@ public void testRequestResponseLimits() throws Exception { Request request = httpClient.newRequest(new URI(String.format("http://localhost:%d/withinlimit/a", httpPort))) .body(new FormRequestContent(formFieldsLimitExceeded)); - try { - CompletableFuture completable = new CompletableResponseListener(request).send(); - ContentResponse response = completable.get(); - assertEquals(413, response.getStatus()); - } catch (ExecutionException e) { - // FIXME this shouldn't happen, but it does with Jetty 12.1.0.beta1 - // java.nio.channels.AsynchronousCloseException - } + CompletableFuture completable = new CompletableResponseListener(request).send(); + ContentResponse response = completable.get(); + assertEquals(413, response.getStatus()); } }