Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

OSGi Service not available in my custom Workflow Process ?

Avatar

Level 2

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).

1625713_pastedImage_1.png

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)

1625715_pastedImage_4.png

Any suggestion what I might be doing wrong?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
4 Replies

Avatar

Community Advisor

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

Avatar

Level 2

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

Avatar

Correct answer by
Community Advisor

Avatar

Level 2

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..!