From 671b33fe47737371029d2840b9488bb7ae7dbe6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Thu, 3 Jul 2025 12:59:26 +0200 Subject: [PATCH 1/3] FELIX-6791 Only a single format can be allowed when using Pax Web - Add unique servlet name to each registered servlet via the whiteboard pattern --- .../felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java index 5c1ca17601..ad1818dce6 100644 --- a/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java +++ b/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/servlet/HealthCheckExecutorServlet.java @@ -20,6 +20,7 @@ import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME; import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN; +import static org.osgi.service.servlet.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME; import java.io.IOException; import java.io.PrintWriter; @@ -253,6 +254,8 @@ public void deactivate() { private void registerServlet(final ServletInfoDTO servletInfo) { final Dictionary properties = new Hashtable<>(); + // FELIX-6791 Add unique servlet name + properties.put(HTTP_WHITEBOARD_SERVLET_NAME, servletInfo.contextName + "." + servletInfo.servletPath + "." + servletInfo.servlet.getClass().getSimpleName()); if (servletInfo.contextName != null && !servletInfo.contextName.isEmpty()) { properties.put(HTTP_WHITEBOARD_CONTEXT_SELECT, "(".concat(HTTP_WHITEBOARD_CONTEXT_NAME).concat("=").concat(servletInfo.contextName).concat(")")); } From 8cb85760696080b27cf68de3a3a28ae089884070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Thu, 3 Jul 2025 13:03:47 +0200 Subject: [PATCH 2/3] FELIX-6791 Only a single format can be allowed when using Pax Web - Add healthcheck core to CI --- .github/workflows/maven-ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/maven-ci.yml b/.github/workflows/maven-ci.yml index febb6fe2ff..8984977b8f 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -11,6 +11,7 @@ on: - 'log/**' - 'webconsole/**' - 'framework/**' + - 'healthcheck/**' pull_request: branches: [ "master" ] paths: @@ -22,6 +23,7 @@ on: - 'log/**' - 'framework/**' - 'gogo/**' + - 'healthcheck/**' permissions: {} @@ -65,6 +67,8 @@ jobs: - 'framework/**' gogo: - 'gogo/**' + healthcheck: + - 'healthcheck/**' - name: Felix SCR if: steps.changes.outputs.scr == 'true' @@ -93,6 +97,9 @@ jobs: - name: Felix Gogo Shell if: steps.changes.outputs.gogo == 'true' run: mvn -B -V -Dstyle.color=always --file gogo/pom.xml clean verify + - name: Felix Healthcheck core + if: steps.changes.outputs.healthcheck == 'true' + run: mvn -B -V -Dstyle.color=always --file core/pom.xml clean verify - name: Upload Test Results if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 From 9430afee025bf65046bad1177a5cadf4ad179ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20R=C3=BCtter?= Date: Thu, 3 Jul 2025 13:05:38 +0200 Subject: [PATCH 3/3] FELIX-6791 Only a single format can be allowed when using Pax Web - Add healthcheck core to CI --- .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 8984977b8f..2c510c1564 100644 --- a/.github/workflows/maven-ci.yml +++ b/.github/workflows/maven-ci.yml @@ -99,7 +99,7 @@ jobs: run: mvn -B -V -Dstyle.color=always --file gogo/pom.xml clean verify - name: Felix Healthcheck core if: steps.changes.outputs.healthcheck == 'true' - run: mvn -B -V -Dstyle.color=always --file core/pom.xml clean verify + run: mvn -B -V -Dstyle.color=always --file healthcheck/core/pom.xml clean verify - name: Upload Test Results if: always() uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2