Skip to main content
Level 2
Jul 15, 2024 5:59 PM UTC
Solved

Calling a service from different bundles

There is a requirement where I have a service (lets say GetBundleInfoservice) in Bundle A. Now I need to access this service in Bundle B. What should be my approach. I have a servlet which returns a Json using that Service. However, I should atleast be able to call the service from Bundle A to Bundle B? Any suggestions?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Saravanan_Dharmaraj
Saravanan_DharmarajAccepted solution
Community Advisor
Jul 15, 2024 6:13 PM UTC

@rekhaad7473 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/access-service-from-another-aem-bundle/m-p/326674

 

You need to make sure the service in Bundle A is getting exported. In Bundle B pom.xml, add the dependency of Bundle A. Once you have the dependency you can instantiate with (@Reference) and call the service methods in Bundle A.

 

2 replies

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
Jul 15, 2024 6:13 PM UTC

@rekhaad7473 

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/access-service-from-another-aem-bundle/m-p/326674

 

You need to make sure the service in Bundle A is getting exported. In Bundle B pom.xml, add the dependency of Bundle A. Once you have the dependency you can instantiate with (@Reference) and call the service methods in Bundle A.

 

Translate
Level 2
Jul 16, 2024 5:51 AM UTC

Thank you, will try this out.

Translate