Calling a service from different bundles | Community
Skip to main content
Level 2
July 15, 2024
Solved

Calling a service from different bundles

  • July 15, 2024
  • 1 reply
  • 727 views

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.
Best answer by Saravanan_Dharmaraj

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

 

1 reply

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
July 15, 2024

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

 

Level 2
July 16, 2024

Thank you, will try this out.