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

Timothy Ward commented on FELIX-4088:
-------------------------------------

1. I'll have a go with the latest snapshot and see what happens.

2. The Paremus code doesn't do anything much beyond logging the call and then 
delegating. I don't see a way in which it could be introducing a thread switch, 
a delay, or that it could filter the event from DS. I'll make sure to keep an 
eye on it while continuing to debug.

3. The configuration has a factory pid matching the name of the DS component, 
and the DS component has a configuration-policy of require:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"; 
name="com.paremus.packager.demos.derby.guard" configuration-policy="require" 
activate="activate">

I'll try to collect some useful logs.

Even if this does turn out to be fixed in a more recent SCR release it still 
might be worth putting a null check in the core framework. I was quite 
surprised to be able to get something so deep in the core to NPE!
                
> NPE from SCR service unregistration
> -----------------------------------
>
>                 Key: FELIX-4088
>                 URL: https://issues.apache.org/jira/browse/FELIX-4088
>             Project: Felix
>          Issue Type: Bug
>          Components: Configuration Admin, Declarative Services (SCR), 
> Framework
>    Affects Versions: framework-4.2.0,  configadmin-1.2.8,  scr-1.6.0
>         Environment: MacOSX 8 processors
>            Reporter: Timothy Ward
>
> When uninstalling a set of bundles I get the following exception.
> ERROR: Bundle com.paremus.dosgi.topologymanager [101] EventDispatcher: Error 
> during dispatch. (java.lang.NullPointerException)
> java.lang.NullPointerException
>       at org.apache.felix.framework.util.Util.getWire(Util.java:335)
>       at 
> org.apache.felix.framework.ServiceRegistrationImpl$ServiceReferenceImpl.isAssignableTo(ServiceRegistrationImpl.java:493)
>       at 
> org.apache.felix.framework.util.Util.isServiceAssignable(Util.java:280)
>       at 
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:916)
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
>       at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4401)
>       at org.apache.felix.framework.Felix.access$000(Felix.java:74)
>       at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:390)
>       at 
> org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:151)
>       at 
> org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:127)
>       at 
> com.paremus.frameworkintercept.DelegatingServiceRegistration.unregister(DelegatingServiceRegistration.java:37)
>       at 
> org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterComponentService(AbstractComponentManager.java:470)
>       at 
> org.apache.felix.scr.impl.manager.AbstractComponentManager$Satisfied.deactivate(AbstractComponentManager.java:1074)
>       at 
> org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:338)
>       at 
> org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:414)
>       at 
> org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationDeleted(ConfiguredComponentHolder.java:152)
>       at 
> org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:247)
>       at 
> org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1832)
>       at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)
>       at java.lang.Thread.run(Thread.java:722)
> ERROR: Bundle org.cauldron.newton.management.monitor [85] EventDispatcher: 
> Error during dispatch. (java.lang.NullPointerException)
> java.lang.NullPointerException
>       at org.apache.felix.framework.util.Util.getWire(Util.java:335)
>       at 
> org.apache.felix.framework.ServiceRegistrationImpl$ServiceReferenceImpl.isAssignableTo(ServiceRegistrationImpl.java:493)
>       at 
> org.apache.felix.framework.util.Util.isServiceAssignable(Util.java:280)
>       at 
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:916)
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793)
>       at 
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543)
>       at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4401)
>       at org.apache.felix.framework.Felix.access$000(Felix.java:74)
>       at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:390)
>       at 
> org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:151)
>       at 
> org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:127)
>       at 
> com.paremus.frameworkintercept.DelegatingServiceRegistration.unregister(DelegatingServiceRegistration.java:37)
>       at 
> org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterComponentService(AbstractComponentManager.java:470)
>       at 
> org.apache.felix.scr.impl.manager.AbstractComponentManager$Satisfied.deactivate(AbstractComponentManager.java:1074)
>       at 
> org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:338)
>       at 
> org.apache.felix.scr.impl.manager.ImmediateComponentManager.reconfigure(ImmediateComponentManager.java:414)
>       at 
> org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationDeleted(ConfiguredComponentHolder.java:152)
>       at 
> org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:247)
>       at 
> org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1832)
>       at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:104)
>       at java.lang.Thread.run(Thread.java:722)
> One of the bundles is an extender, that publishes a Configuration using 
> Config Admin. This configuration is picked up by DS to create a new Service 
> using a ManagedServiceFactory.
> At some point in the teardown I seem to be in the state where:
> 1. The configuration is being deleted because the target bundle is being 
> uninstalled
> 2. The Bundle containing the SCR component is being uninstalled
> 3. SCR is attempting to unregister the managed service because of the 
> asynchronous notification from config admin.
> I'm not sure whether the fault lies with the core framework or with scr, or 
> with config admin. My guess is that SCR is at fault for trying to unregister 
> a service for an uninstalled bundle, but that the framework shouldn't be 
> blowing up either. Config Admin is probably an innocent bystander. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to