Skip to main content
kev_var
Level 2
Oct 16, 2015 2:27 AM UTC
Solved

programatically get the version of AEM inside a servlet

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.
Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:27 AM UTC

3 replies

kev_var
kev_varAuthor
Level 2
Oct 16, 2015 2:27 AM UTC

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

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:27 AM UTC

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.  

Translate
Sham_HC
Sham_HCAccepted solution
Level 10
Oct 16, 2015 2:27 AM UTC