OSGI Annotations with Communities Components

gurjeets 16-10-2018

We are trying to upgrade from AEM 6.2 to AEM 6.4.

With this upgrade we are also updating our code to use OSGI annotations instead of R6 annotations.

I completed all the updates as per examples and guidelines available to migrate R6 to OSGI annotations. Code compiles fine without errors, but the components are not working.

For example the Component annotation for extended JOURNAL component is :

@Component(immediate = true,

  service = SocialComponentFactory.class,

  property = {

   "service.ranking = 50",

   "priority= 10",

   "sling.servlet.resourceTypes=/apps/keysight-blog/components/communities/entry_topic"
   })

For all the components we are getting the same error:

Caused by: java.lang.NullPointerException: null

        at com.adobe.cq.social.scf.core.AbstractSocialComponentFactory.getClientUtilities(AbstractSocialComponentFactory.java:70)

        at com.blog.core.components.BlogSocialTagCloudCollectionSocialComponentFactory.getSocialComponent(BlogSocialTagCloudCollectionSocialComponentFactory.java:47) [com.blog.company-web:0.0.1]

        at com.adobe.cq.social.handlebars.HandlebarsScriptingEngineFactory.getSocialComponentForResource(HandlebarsScriptingEngineFactory.java:272)

        at com.adobe.cq.social.handlebars.HandlebarsScriptingEngine.eval(HandlebarsScriptingEngine.java:130)

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388) [org.apache.sling.scripting.core:2.0.54]

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.0.54]

        at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.0.54]

Is it ok to to use OSGI annotations with extended communities components. Is there an example or some code for reference on how communities components can be created/extended using OSGI annotations.

Accepted Solutions (0)

Answers (0)