felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5344) HTTP_WHITEBOARD_TARGET doesn't work reliably
Date Tue, 13 Sep 2016 20:14:20 GMT

    [ https://issues.apache.org/jira/browse/FELIX-5344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15488285#comment-15488285

Carsten Ziegeler commented on FELIX-5344:

The problem is that two methods are called start() and setProperties() on the controller.
While the initial design of http.base was to simply rely on init/destroy of the registered
servlet, this has been changed over time. I think we should merge the start and setProperties
method into a single one, avoiding the need of synchronizing and actually simplifying the
implementation in http.base as well.

> HTTP_WHITEBOARD_TARGET doesn't work reliably
> --------------------------------------------
>                 Key: FELIX-5344
>                 URL: https://issues.apache.org/jira/browse/FELIX-5344
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http.base-3.0.12, http.jetty-3.2.4
>            Reporter: Derek Baum
>             Fix For: http.base-3.0.14, http.jetty-3.2.6
> I am trying to use HTTP_WHITEBOARD_TARGET to match a specific http instance:
> (I'm actually experimenting with multiple http instances, but the problem occurs with
a single instance).
> @Component(service = Servlet.class,
> 	property = {
> HttpWhiteboardConstants.HTTP_WHITEBOARD_TARGET + "=(org.osgi.service.http.port=7777)"
>         })
> I am configuring http.jetty using config admin (via fileinstall)
> I have disabled automatic jetty startup using:
> org.apache.felix.http.enable=false
> Now I start jetty by dropping the file org.apache.felix.http.cfg into the fileinstall
load directory:
> org.apache.felix.http.enable=true
> org.osgi.service.http.port=7777
> and my servlet is not always registered.
> This appears to be because WhiteboardManager.addWhiteboardService() is being called before
the http service properties have been set.
> Here's the output of some debug I added to isMatchingService():
> XXXtarget =(org.osgi.service.http.port=7777) match=false
> XXXprop objectClass=[Ljava.lang.String;@292aebaf
> XXXprop osgi.http.service.id=[60]
> XXXprop service.bundleid=22
> XXXprop service.id=61
> XXXprop service.scope=singleton
> It doesn't contain any endpoint properties.
> To prove this is a timing issue, I stopped and started my web bundle, which then registered
correctly. The corresponding debug is:
> XXXtarget =(org.osgi.service.http.port=7777) match=true
> XXXprop objectClass=[Ljava.lang.String;@292aebaf
> XXXprop org.apache.felix.http.enable=true
> XXXprop org.apache.felix.https.enable=false
> XXXprop org.osgi.service.http.port=7777
> XXXprop org.osgi.service.http.port.secure=8443
> XXXprop osgi.http.endpoint=[Ljava.lang.String;@1d1447fa
> XXXprop osgi.http.service.id=[60]
> XXXprop service.bundleid=22
> XXXprop service.id=61
> XXXprop service.scope=singleton

This message was sent by Atlassian JIRA

View raw message