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

Karl Pauls commented on FELIX-5995:
-----------------------------------

Right, there was an NPE sometimes. It looked like this:

{noformat}
[FelixStartLevel] org.apache.felix.http.jetty [ServiceReference 114 from bundle 
62 : org.apache.sling.startupfilter:0.0.1.Rev1764485 ref=[javax.servlet.Filter] 
properties={objectClass=[javax.servlet.Filter], 
osgi.http.whiteboard.context.select=(osgi.http.whiteboard.context.name=*), 
osgi.http.whiteboard.filter.pattern=/, service.bundleid=62, service.id=114, 
service.ranking=36864, service.scope=singleton, sling.filter.scope=REQUEST}] 
Exception while registering Filter service (java.lang.NullPointerException)
{noformat}

However, I still think that it makes sense to have the whiteboard be stopped 
before the httpServiceFactory. Unfortunately, there is this special case 
namely, that services registered with the http service directly are not stopped 
because the whiteboard provides the default context and they end-up being in 
that context. The stop of the whiteboard does clean-out the context(s) but only 
destroys the services that it published itself. For the one added via the http 
service it doesn't call destroy even so it releases the context - hence, 
afterwords, when the http service is stopped it doesn't find the service in the 
context anymore and it doesn't destroy it either. 

Oh well, I'm not familiar enough with the code to fix this - feel free to 
rollback the change for now and maybe push this issue out.

> HttpService HttpServiceController should stop whiteboardManager before 
> httpServicefactory
> -----------------------------------------------------------------------------------------
>
>                 Key: FELIX-5995
>                 URL: https://issues.apache.org/jira/browse/FELIX-5995
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http.jetty-4.0.6, http.base-4.0.4, http.bridge-4.0.4
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>            Priority: Major
>             Fix For: http.base-4.0.6, http.jetty-4.0.8, http.bridge-4.0.6
>
>
> The HttpServiceController does in the register method start the 
> httpServiceFactory and then the whiteboardManager. In the unregister method, 
> it does stop the httpServiceFactory and then the whiteboardManager. That 
> creates a problem as the whiteboardManager needs a started httpServiceFactory 
> when services come in. 
> The fix should be simple, we should stop the whiteboardManager before we stop 
> the httpServiceFactory.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to