programatically get the version of AEM inside a servlet | Community
Skip to main content
kev_var
Level 2
October 16, 2015
Solved

programatically get the version of AEM inside a servlet

  • October 16, 2015
  • 3 replies
  • 1187 views

Hi all,

 I have custom app which runs on AEM. For certain use case I need to get the version of the AEM on which the app is running on. how can get this version number inside a servlet.

Any help would be appreciated.

thanks,

Kevin

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 Sham_HC

Hi Kevin,

Use granite product service api http://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/adobe/granite/license/ProductInfo.html

Thanks,

Sham

3 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015
smacdonald2008
Level 10
October 16, 2015

One area to explore is using MBEAN app logic to get information from CQ. See this AEM topic that talks about MBEAN:

http://docs.adobe.com/docs/en/cq/5-5/developing/jmx-integration.html

We have a community article that shows you how to use MBEAN from within an OSGi service operation:

http://helpx.adobe.com/experience-manager/using/aem-first-components1.html

This article shows how to use MBEAN within an OSGi to count stale workflows - replace that MBEAN logic with the MBEAN logic you need to address your use case. Something like:

http://stackoverflow.com/questions/1270173/accessing-a-remote-mbean-server

Update: You can get crx version using jmx - use the Product API to get server version.  

kev_var
kev_varAuthor
Level 2
October 16, 2015

Hello everyone,

Thank you Sham and smacdonald2008 for the quick response. I tried out Sham suggestion first (cause that was the shorter one :P) and that worked. Here is what I added to my servlet

@Reference private ProductInfoProvider productInfo;

and then referred the version like

productInfo.getProductInfo().getShortVersion();

Thanks again,

 

best,

kevin