You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Paul Rütter (Jira)" <ji...@apache.org> on 2025/07/03 11:05:00 UTC
[jira] [Commented] (FELIX-6791) Only a single format can be allowed when using Pax Web
[ https://issues.apache.org/jira/browse/FELIX-6791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17993044#comment-17993044 ]
Paul Rütter commented on FELIX-6791:
------------------------------------
[~jjapache] can you try with this snapshot build? [^org.apache.felix.healthcheck.core-2.3.1-SNAPSHOT.jar]
I have a PR with the changes in [https://github.com/apache/felix-dev/pull/430,] still checking CI.
> Only a single format can be allowed when using Pax Web
> ------------------------------------------------------
>
> Key: FELIX-6791
> URL: https://issues.apache.org/jira/browse/FELIX-6791
> Project: Felix
> Issue Type: Bug
> Components: Health Checks
> Affects Versions: healthcheck.core 2.0.14, healthcheck.core 2.1.0
> Environment: org.apache.felix.healthcheck.core 2.0.14
> org.ops4j.pax.web.pax-web-spi 8.30.0
> Reporter: Jonathan Wright
> Assignee: Paul Rütter
> Priority: Minor
> Attachments: org.apache.felix.healthcheck.core-2.3.1-SNAPSHOT.jar, stacktrace.txt
>
>
> {{HealthCheckExecutorServlet}} registers a new instance of {{HealthCheckExecutorServlet$ProxyServlet}} for each allowed format. However, it does not supply a unique name for each instance. This violates [Section 102.2|https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.http.html#i1223311] of the OSGi Http Service Specification, which includes the following statement:
> {quote}All {{Servlet}} objects and resource registrations share the same name-space. If an attempt is made to register a resource or {{Servlet}} object under the same name as a currently registered resource or {{Servlet}} object, a {{NamespaceException}} is thrown.
> {quote}
> Pax Web enforces the above mentioned requirement (see [^stacktrace.txt]). As a result, only one instance of {{HealthCheckExecutorServlet$ProxyServlet}} is registered. To prevent {{Servlet}} registration errors when using Pax Web, you have to set the {{allowed.formats}} configuration property to a single value, e.g. {{{}allowed.formats=["json"]{}}}.
> You cannot specify a name when registering a {{Servlet}} via the {{org.osgi.service.http.HttpService}} API, so the 2.0.14 version of {{HealthCheckExecutorServlet}} would need to be updated to use the Whiteboard Pattern. The 2.1.0 version, which does use the Whiteboard Pattern, simply needs to specify a unique {{osgi.http.whiteboard.servlet.name}} property value for each {{HealthCheckExecutorServlet$ProxyServlet}} instance.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)