org.osgi.framework.ServiceException: Service factory returned null | Community
Skip to main content
October 16, 2015
Solved

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

  • October 16, 2015
  • 2 replies
  • 12820 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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-manager.topic.html/forum__an0w-i_have_installedcq5.html

2 replies

smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015

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-manager.topic.html/forum__an0w-i_have_installedcq5.html

New Participant
April 12, 2022


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

October 16, 2015

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-manager.topic.html/forum__an0w-i_have_installedcq5.html

 

 

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.

New Participant
April 12, 2022

is your issue is resolved?

if yes can you please help me with the link