Skip to content

Commit 0eed566

Browse files
committed
fix(jakarta): webconsole needs http-whiteboard for Felix WebConsole 5.0.18 servlet registration
Felix WebConsole 5.0.18 registers its OsgiManager servlet via OSGi HTTP Whiteboard (jakarta.servlet.Servlet service) instead of the legacy HttpService. The pax-web-extender-whiteboard bundle is required to process this registration, so the webconsole feature now depends on http-whiteboard instead of http. Also fix HttpTest.testIncorrectProxyUrlFails to handle the IllegalArgumentException thrown by the new validateUrl() in ProxyServiceImpl for URLs not starting with '/'.
1 parent de149c2 commit 0eed566

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

assemblies/features/standard/src/main/feature/feature.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ uninstall = admin
952952
</feature>
953953

954954
<feature name="webconsole" description="Base support of the Karaf WebConsole" version="${project.version}">
955-
<feature>http</feature>
955+
<feature>http-whiteboard</feature>
956956
<feature>jaas-boot</feature>
957957
<config name="org.apache.karaf.webconsole">
958958
################################################################################

itests/test/src/test/java/org/apache/karaf/itests/HttpTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ public void testProxy() throws Exception {
7474

7575
@Test
7676
public void testIncorrectProxyUrlFails() throws Exception {
77-
executeCommand("http:proxy-add no-slash-prefix http://karaf.apache.org");
77+
try {
78+
executeCommand("http:proxy-add no-slash-prefix http://karaf.apache.org");
79+
} catch (RuntimeException e) {
80+
// expected - validateUrl rejects URLs not starting with '/'
81+
}
7882
String output = executeCommand("http:proxy-list");
7983
assertContainsNot("no-slash-prefix", output);
8084
}

0 commit comments

Comments
 (0)