Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Service Factory returning null after deploying project into aem

Avatar

Level 8

Hi, 

 

I created a project with this cmnd 
mvn -B archetype:generate
-D archetypeGroupId=com.adobe.aem
-D archetypeArtifactId=aem-project-archetype
-D archetypeVersion=26
-D appTitle="WKND SPA React"
-D appId="wknd-spa-react"
-D artifactId="aem-guides-wknd-spa.react"
-D groupId="com.adobe.aem.guides.wkndspa.react"
-D frontendModule="react"
-D aemVersion="6.5.11.0"
then after I deployed it to aem instance then i am getting the below error
 *ERROR* [FelixDispatchQueue] org.apache.felix.inventory FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter (3379)))
org.osgi.framework.ServiceException: Service factory returned null. (Component: org.apache.sling.commons.metrics.rrd4j.impl.CodahaleMetricsReporter (3379))
    at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:381)
    at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:248)
    at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
    at org.apache.felix.framework.Felix.getService(Felix.java:3954)
    at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:450)
    at org.apache.felix.inventory.impl.InventoryPrinterManagerImpl.addingService(InventoryPrinterManagerImpl.java:127) [org.apache.felix.inventory:1.1.0]
    at org.apache.felix.inventory.impl.InventoryPrinterManagerImpl.addingService(InventoryPrinterManagerImpl.java:48) [org.apache.felix.inventory:1.1.0]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871)
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903)
    at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
    at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
    at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
    at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4833)
    at org.apache.felix.framework.Felix.registerService(Felix.java:3804)
    at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:328)
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:907) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:893) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:128) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:960) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:733) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enableInternal(AbstractComponentManager.java:667) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:433) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:666) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:353) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:553) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.Activator.access$200(Activator.java:69) [org.apache.felix.scr:2.1.20]
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:424) [org.apache.felix.scr:2.1.20]
   
1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Vani1012 

 

Please add the value immediate = true to all your service impl classes so that they would become available once the code is installed.

 

Thanks,

Kiran Vedantam.

View solution in original post

6 Replies

Avatar

Community Advisor

HI @Vani1012 

 

A couple of quick questions:

  1. Is the AEM version used to create the project (6.5.11) is same as your local version?
  2. Do you see all your bundles active?
  3. Can you try immediate = true for your services and check?

Related issues: https://issues.apache.org/jira/browse/FELIX-3850 

 

Thanks,

Kiran Vedantam

Avatar

Level 8

Hi @Kiran_Vedantam ,

yes I have 6.5.11 version and all the bundles are active only I didnt understand the third step you mentioned that is 

  1. Can you try immediate = true for your services and check?

on which service class I have to use that immediate=true?

Can you please explain.

Avatar

Correct answer by
Community Advisor

Hi @Vani1012 

 

Please add the value immediate = true to all your service impl classes so that they would become available once the code is installed.

 

Thanks,

Kiran Vedantam.

Avatar

Employee Advisor

HI @Vani1012 ,

 

Is the SP11 installed to the aem server before deploying the code ? If not please download the SP11 from 
software distribution link.

 

And follow:

  • Start server
  • Install service pack downloaded above using package manager
  • Restart local aem instance
  • Deploy custom code 
  • Check if the bundle goes active.

Thanks,

Milind

Avatar

Level 8

Hi @milind_bachani ,

 I installed sp11 before I deploy the code into author instance the steps that you mentioned above I did as it is but the issue isnt fixed, please help me to fix this.