Expand my Community achievements bar.

SOLVED

org.osgi.framework.ServiceException: Service factory returned null

Avatar

Former Community Member

Hi,

We are seeing some strange issues with our deployments on environments. We get the below problem too often where the services are not registered. The service status is registered in most cases when you look at <host>:<port>/system/console/components. 

The strange thing is that if you restart the CQ instance the problem goes away. This does not happen on every system all the time but when it happens most of our services don't get registered. I looked few services that were not active and the class had references to other services (all of which were active) even still that service was inactive.

Note: We have bind and unbind methods in all our classes. Any ideas what might be the root cause?

05.03.2015 09:23:49.413 *WARN* [SCR Component Actor] aaaaaaaa.core-bundle [aaaaaaaa.adapters.JcromAdapter] Could not get service from ref [aaaaaaaa.adapters.factory.JcromServiceFactory]
05.03.2015 09:23:49.413 *ERROR* [FelixDispatchQueue] aaaaaaaa.core-bundle 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:341)
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
        at org.apache.felix.framework.Felix.getService(Felix.java:3556)
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
        at org.apache.felix.scr.impl.helper.BindMethod.getServiceObject(BindMethod.java:563)
        at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1091)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:768)
        at org.apache.felix.scr.impl.manager.ImmediateComponentManager.getService(ImmediateComponentManager.java:650)
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
        at org.apache.felix.framework.Felix.getService(Felix.java:3556)
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
        at org.apache.felix.scr.impl.helper.BindMethod.getServiceObject(BindMethod.java:563)
        at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1091)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:768)
        at org.apache.felix.scr.impl.manager.ImmediateComponentManager.getService(ImmediateComponentManager.java:650)
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
        at org.apache.felix.framework.Felix.getService(Felix.java:3556)
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
        at org.apache.felix.scr.impl.helper.BindMethod.getServiceObject(BindMethod.java:563)
        at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1091)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:768)
        at org.apache.felix.scr.impl.manager.ImmediateComponentManager.getService(ImmediateComponentManager.java:650)
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:308)
        at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:219)
        at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:320)
        at org.apache.felix.framework.Felix.getService(Felix.java:3556)
        at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:468)
        at org.apache.felix.scr.impl.helper.BindMethod.getServiceObject(BindMethod.java:563)
        at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1091)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:768)
        at org.apache.felix.scr.impl.manager.ImmediateComponentManager.getService(ImmediateComponentManager.java:650)
        at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(S

1 Accepted Solution

Avatar

Correct answer by
Level 10

Are you seeing a situation where the service factory works as expected and then all of a sudden it stops working or did the Service Factory ever work? 

What version of CQ are you using? 

Is this after an upgrade? If so - look at http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Are you seeing a situation where the service factory works as expected and then all of a sudden it stops working or did the Service Factory ever work? 

What version of CQ are you using? 

Is this after an upgrade? If so - look at http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

Avatar

Level 1


I am not able to open the above link, could you please help me with the link.
Thanks in advance

Avatar

Level 1

The above link is redirecting to https://community.adobe.com/

and it is not working or redirecting to the correct one.

Avatar

Former Community Member

smacdonald2008 wrote...

Are you seeing a situation where the service factory works as expected and then all of a sudden it stops working or did the Service Factory ever work? 

What version of CQ are you using? 

Is this after an upgrade? If so - look at http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

 

 

Thanks for your reply smacdonald. We are using 5.6.1. We see the issue after deployment usually. Our normal deployment process is delete the packages under /etc/packages build the bundle and deploy it to author and then just replicate them to the publishers. So, yes all of sudden after deployment service factory starts returning null but after a restart of AEM the services are back to active.

Avatar

Level 1

is your issue is resolved?

if yes can you please help me with the link