OSGi Service not available in my custom Workflow Process ? | Community
Skip to main content
Level 2
November 20, 2018
Solved

OSGi Service not available in my custom Workflow Process ?

  • November 20, 2018
  • 4 replies
  • 2034 views

Hi ,

I am using AEM6.4 and I have created an OSGi service which I'm trying to call from my custom workflow process but getting NullPointerException when calling these service methods. ;/

Even when hovering over on the service object declared within my workflow process -it shows null. (refer screenshot below).

Also, I have used apache felix scr 'Reference' annotation here. Not sure if that is expected in 6.4?

And yes, my bundle is compiled(without any error), installed and active. (refer screenshot below)

Any suggestion what I might be doing wrong?

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

4 replies

arunpatidar
Community Advisor
Community Advisor
November 21, 2018

Hi,

could be issue with SCR Felix reference annotation if you are using osgi annotation to declare process service, try with Osgi R6 annotations

import org.osgi.service.component.annotations.Reference;

Arun Patidar
Level 2
November 21, 2018

Hi Arun,

Thanks for your suggestion, yes, using the 'org.osgi.service.component.annotations.Reference;' worked.

One more question on the same node, I have to introduce some OSGi config (say: service.endpoint.url) for the same service using @Property annotation but I'm unable to.

The service builds successfully and is available under the bundle but the entry under the -'/system/console/ConfigMgr' to add respective configuration isn't available.

Unfortunately the @Property annotation I can't find under OSGi hence using the 'org.apache.felix.scr.annotations.Property;' annotations for that.

Please suggest what could be wrong here?

Or share a post/link with an example of an OSGi service in AEM6.4 using the following annotations:-

@Component

@Service

@Reference

@Property

- Thanks

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
November 21, 2018
Level 2
November 21, 2018

Thanks, Arun - you are a savior..!

This is exactly what I was looking for but was unable to find anything relevant even on Adobe helpx docs.

One more thing - I have another open question in Adobe forum, can you please see if you can guide with that too.

Thanks again..!