Derek Baum created FELIX-5344:
---------------------------------

             Summary: 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.jetty-3.2.4, http.base-3.0.12
            Reporter: Derek Baum


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
(v6.3.4#6332)

Reply via email to