Hi Joseph,

Had a short look at the source of RuleAdaptersFactoryImpl. This
component implements the ServiceListener. In the noted line the
RuleAdaptersFactoryImpl  tries to to get the Service for the
ServiceReference parsed in the Event. This seams to fail (as noted by
the Exception) in this specific case of a ServiceEvent.UNREGISTERING
type event.

This exception will not have any influence as (1) the
RuleAdaptersFactoryImpl is not related to the Stanbol Enhancer and (2)
the unregistered service is not a RuleAdapter - so even the
RuleAdaptersFactoryImpl will continue to work as expected.

To avoid this exception the RuleAdaptersFactoryImpl would need to keep
track of ServiceReferences for managed RuleAdapter instances. In that
case it could handle ServiceEvent.UNREGISTERING type events without
accessing the actual service.

best
Rupert


On Mon, Jun 17, 2013 at 4:29 PM, Joseph M'Bimbi-Bene
<jbi...@object-ive.com> wrote:
> hello, i just saw a strange error in the logs after i modified the
> enhancement chain. The enhancing works in the web console, so i don't know
> how much of a problem it really is but here is the log excerpt:
>
> Since it is a problem with felix, it may be more appropriate to post it in
> the Felix mailing list. But since the error was thrown by a Stanbol module,
> it may be a problem with Stanbol and not Felix
>
> 17.06.2013 16:27:18.283 *ERROR* [FelixDispatchQueue]
> org.apache.stanbol.enhancer.chain.weighted FrameworkEvent ERROR
> (org.osgi.framework.ServiceException: Service factory returned null.)
> org.osgi.framework.ServiceException: Service factory returned null.
>     at
> org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:343)
>     at
> org.apache.felix.framework.ServiceRegistrationImpl.access$100(ServiceRegistrationImpl.java:37)
>     at
> org.apache.felix.framework.ServiceRegistrationImpl$ServiceFactoryPrivileged.run(ServiceRegistrationImpl.java:374)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:216)
>     at
> org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:297)
>     at org.apache.felix.framework.Felix.getService(Felix.java:3014)
>     at
> org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)
>     at
> org.apache.stanbol.rules.adapters.impl.RuleAdaptersFactoryImpl.serviceChanged(RuleAdaptersFactoryImpl.java:100)
>     at
> org.apache.felix.framework.util.EventDispatcher$5.run(EventDispatcher.java:864)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at
> org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:860)
>     at
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)
>     at
> org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)
>     at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3769)
>     at org.apache.felix.framework.Felix.access$000(Felix.java:80)
>     at org.apache.felix.framework.Felix$2.serviceChanged(Felix.java:722)
>     at
> org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:135)
>     at
> org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:129)
>     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:426)
>     at
> org.apache.felix.scr.impl.config.ConfiguredComponentHolder.configurationUpdated(ConfiguredComponentHolder.java:210)
>     at
> org.apache.felix.scr.impl.config.ConfigurationComponentRegistry.configurationEvent(ConfigurationComponentRegistry.java:277)
>     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(Unknown Source)



-- 
| Rupert Westenthaler             rupert.westentha...@gmail.com
| Bodenlehenstraße 11                             ++43-699-11108907
| A-5500 Bischofshofen

Reply via email to