Ask Me ?

Hi Readers,

Here you may comment all the questions/ doubts which you encountered during your journey for AEM. I will try my best to help you out and might connect with you to solve them too.

Also you may post interesting questions which you went through during your respective interviews , and I will try to answer them and thereby increase the Question Bank for masses.

So go ahead and post the questions !!

Thanks a lot .



563 thoughts on “Ask Me ?

  1. Hi Hashim,

    I’m extending ‘com.adobe.cq.sightly.WCMUsePojo’ class and using request session in it to set some properties on content node (current resource). so I want to logout my session after performing that operation.

    I’m doing it using below code snippet.

    if(null != requestSession) {

    But while doing it I’m getting below error. service: Uncaught SlingException
    java.lang.IllegalArgumentException: javax.jcr.RepositoryException: This session has been closed.

    So is that not necessary to do session logouts in ‘WCMUsePojo’ extending classes? If we don’t do it, will Sling take care of it automatically?

    Thanks in Advance Hashim…



  2. Is there any way to get Mock Object of FrameworkUtil. We are using AEM mock for unit testing. Below is method :- public static T getServiceReference(Class serviceClass) {
    T serviceRef;
    BundleContext bundleContext = FrameworkUtil.getBundle(serviceClass).getBundleContext();
    ServiceReference osgiRef = bundleContext.getServiceReference(serviceClass.getName());
    serviceRef = (T) bundleContext.getService(osgiRef);
    return serviceRef;
    While testing i’m getting null pointer exception on FrameworkUtil.getBundle(serviceClass). Can you please help me here.


    • Hi,
      For AEM developer exam you need to know AEM development first, as the questions asked there are scenario based and not all of them could be answered just by cramping up things. I would suggest first gain some experience via few projects and then attempt for the exam. I cant time base it in general.


  3. Hi Hashim,
    Need your help on the Dispatcher Configuration setup. I’m trying to configure Dispatcher for the first time. I’ve followed all the instructions given on the internet and I’m able to cache my Sample Website for now but it’s working as expected in IE Browser only. When I open the same page on Chrome, it’s not getting cached. Is there any setting that I’ve to explicitly add to make it work in Chrome?

    Steps followed:
    –> Installed Apache httpd Server (on 8081 port)
    –> Installed Dispatcher
    –> Made all the requireed changes in httpd.conf and dispatcher.any file.

    Also, Is it mandatory to logged on AEM Publish instance when we’re hitting a page via Dispatcher? Like, I’m accessing this page “http://localhost:8081/content/geometrixx-outdoors/en/women.html” when I’m logged in AEM Publish Instance, it’s working fine but when I’m logged out from AEM publish Instance and trying to hit this URL, I’m getting an error which says : Bad Gateway The proxy server received an invalid response from an upstream server.


    • Change the dispatcher logs to Debug to identify whats the issue. I don’t think there should be any browser specific caching configurations in Dispatcher configs. There isnt any specific dispatcher configurations for chrome. Logs would give you better idea.

      Second part, its not necessary to login to Publisher if you are accessing a public page via Dispatcher. Do check your allowauthorized flag and if the page needs a signin to display. Check dispatcher logs to debug more.


  4. Hi Hashim ,

    On CQ 5.4 we are facing an issue of CQ author portal unavailability,however the author process is running fine. When we checked the server.log due to a tree replication(bulk content deployment) the issue occurred
    The log was like this – 30.08.2017 03:01:48 *WARN * servletengine: Thread pool limit reached.

    I just went thru this link where they have mentioned that in such situations we can increase the default value of

    Can you put some thoughts on the same . Can we increase the count, if yes what is your recommendation.

    NavinKumar KB


    • Hi Naveen,
      It means that in your instance simultaneous threads are running which is reaching the limit of the instance. In earlier versions of AEMs this was an issue which they improved in future versions. Take frequent thread dumps to identify whats the root cause for this. Also check if some schedular / workflow process / constant JCR changes are happening in your instance. There could also be Lucene indexing happening in backend due to constant content changes . Thread dumps / JVM profiler can give you a better picture.


  5. Hi Hashim,

    I am getting an issue after mounting a dispatcher on Author instance.

    After logging on author dispatcher amd creating a new page and using few components(like image )
    Once this is refreshed ,my components configured on page are not rendering until and unless i clear my browser cache.

    I want to tell you that i havent configured dispatcher flush agent because i am not caching /content.
    I am only caching lib, app and etc
    Specially i am targeting js and css files.

    Can you please help me here?


    • Hi Manish,
      You should create appropriate caching rules for Dispatcher cache . If the *.htmls are getting cache there should be something wrong with the configurations. Check the dispatcher folder and dispatcher logs to debug further.


  6. Hi Hashim,
    i am trying to create Livecopy using Blueprint facility for in my project. While i am creating live copy using New Site option, selected Blueprint and langauages not showing up, navigate next step and selected chapters , selected live copy tick and roll out and finish. after this livecopy is not creating at all.

    what could be the problem? there is no language to select, is it causing the issue? could you please help on this?


  7. Hi Hashim,

    i am developing a search component in our project. Our requirement is not to show some content pages /specific content when we do search. So how can i exclude that content from searching .

    Thanks in advance


  8. Hi,
    I have a doubt in the below question. Please help me out
    There is an external dependency that you have included in your pom.xml file. But when you install the bundle in felix console, bundle is not active. To include the classes from the external dependency, which one of the below will you use ?


  9. Hi Hashim,
    The size of Author and Publish instances are increasing drastically, right now 107 to 110 GB..
    I used to perform offline compaction which ealier used to free up a lot of space, but it seems to free only about 10 GB now.
    What might be the cause and if possible, a solution for this?


  10. Hello, we have problem w CFP 8 installed on AEM. It changes DOM structure our custom multistep form so that we can’t see tabs (LIs in OL) anymore, just a list… What should be the best approach to solve this issue? Introduce new class and correct styles or amend JS files? Many thank for your answer.


  11. Hi Hashim,

    We ran online garbage collection on our Author but after the restart author is not starting. The log files say “Segment not found”. I tried backing up from the latest good revision(Source –, but the search ended in “No good revision found”.
    Please suggest what needs to be done in this case.
    We’re using Adobe Experience Manager, Version 6.2.0.SP1-CFP4. Thank you.
    – Ekta


  12. This question is regarding handlebars login component in AEM 6.3.

    In the file(/libs/social/console/components/hbs/login/login.hbs),
    there are parameters like redirectUrl and loginUrl. Now from handlebars syntax,
    we understand that these are handlebar expressions whose data will be dynamically replaced,
    but from where the data is getting populated. looks like there is some json binding.
    Could you please give clarity if you have worked on handlebars?


  13. Hi Hashim,

    i Need to upload package on local AEM setup.
    im not able to upload package on console bcoz of it is restricted on network level.
    So im dropping package on INSTALL folder in CRX_QUICKSTART…..

    Im trying to upload my DAM package — (package 1-6GB, package 2-6GB) and dropped it to INSTALL folder…but its not reflecting in console?small packages are reflecting ..please advice.


  14. im getting below when i upload a package(6GB).But im able to upload small packages,i have attached the result on below:

    C:\Users\gopinath.m>curl -u admin:admin -F file=@”C:\Users\gopinath.m\Downloads\” -F name=”mph_Dam2″ -F force=true -F install=true http://localhost:

    | Arguments | Comment |
    | cmd=help | print this help |
    | cmd=ls | print a list of all packages |
    | cmd=rm | remove a package |
    | name | package name |
    | [group] | group name (optional) |
    | cmd=build | build a package |
    | name | package name |
    | [group] | group name (optional) |
    | cmd=inst | install a package |
    | name | package name |
    | [strict] | true to fail on error |
    | [group] | group name (optional) |
    | cmd=uninst| uninstall a package |
    | name | package name |
    | [group] | group name (optional) |
    | GET | download a package |
    | | (content-disposition header contains |
    | | the correct filename) |
    | [cmd=get] | optional |
    | name | package name |
    | [group] | group name (optional) |
    | POST | upload a new package |
    | file | package to upload |
    | [name] | optional name |
    | [strict] | true to fail on install error |
    | [install] | automatically install package if ‘true’ |


    C:\Users\gopinath.m>curl -u admin:admin -F file=@”C:\Users\gopinath.m\Downloads\” -F name=”mph_Dam1″ -F force=true -F install=true http://localhost:





    Installing content…
    Creating snapshot for package my_packages:Mph_Dam1
    A META-INF/vault
    A META-INF/vault/config.xml
    A META-INF/vault/filter.xml
    A META-INF/vault/nodetypes.cnd
    A META-INF/vault/properties.xml
    A /.content.xml
    A /content
    A /content/.content.xml
    A /content/dam
    A /content/dam/.content.xml
    – Aggregation status: 2 of 0 prepared, 1 collected
    A META-INF/vault/definition/.content.xml
    Collecting import information…
    Installing node types…
    – rep -> internal
    – nt ->
    – sling ->
    – sling:Folder
    – sling:OrderedFolder
    – sling:Redirect
    – sling:Resource
    – rep:RepoAccessControllable
    Installing privileges…
    Importing content…
    U /
    – /content
    – /content/dam
    A /content/dam/mphasisblog-lkeue
    A /content/dam/mphasisblog-lkeue/resource-assets
    A /content/dam/mysite-iv4kr
    A /content/dam/mysite-iv4kr/resource-assets
    A /content/dam/plainsite-civtt
    A /content/dam/plainsite-civtt/resource-assets
    saving approx 7 nodes…
    Package imported.
    Package installed in 281ms.



  15. HI Hashim,

    We have created some custom metadata fields by touch UI by creating DAM metadata schema and applying schema to our client specific folder. But we are unable to do the same for classic UI. Unable to create metadata properties for DAM assets in classic UI. Below link is not giving more information
    “ New Metadata Property for Assets”

    Can you give info on how to create DAM metadata properties in Classic UI and applying to client specific folder. (In addition to existing fields, needs to add additional fields. I tried Metadata Template in classic UI , but of no use.)

    Liked by 1 person

  16. HI Hashim,

    I want to customize the “Start workflow” wizard while starting a workflow in Touch UI. needs to add more additional fields and wants to save them in metadata . Can you guide me how to customize the “Start Workflow” wizard to add new fields in AEM 6.3 Touch UI, and how to apply this customization to our client specific workflows only ??

    Thanks & Regards,

    Liked by 1 person

    • Hi,
      Please take a look at these paths for such customizations :

      Make sure you override the libs files into your apps folders to change anything .

      Liked by 1 person

      • Hi Hashim,

        In extension of above scenario, can I know how to control form fields based on selection of a value in dropdown of another field. Actually I found an article in below link which we will be used for controlling fields based on our selection in touch UI dialog (cq:dialog). But in html page, when we are working on form, how can we control some widgets to show and hide based on our selection in dropdown ?

        Example : In sites after selecting a page -> Create workflow -> In “Create workflow” page, If we select our project related workflow from dropdown, I need to display two more fields otherwise I want to hide them.

        The below links explains similar scenario under Touch UI dialog (cq:dialog) but not in Form.
        Please guide !!!


  17. Hi Hashim,
    We are using runmode (author,,, similarly for publish too) configs(corresponding to osgi component) in our project. When I checked OSGI console, some configs are not bound and default values (which I mentioned in java component code) are displayed but not environment specific. Also, one more thing I observed is, some config whose values are displayed properly according to environment, and If I change any of its value in code and redeploy. It gets screwed and newly modified value is not displayed.

    Any idea why is this happening only for few configs.

    Thanks in advance


  18. What is the difference between ResourceResolver and ResourceResolverFactory interface? If we use both the interfaces to access the resources, hence in which scenario we should use these interfaces?


  19. Hi Hashim,
    Can you provide some guidance on creating Lucene index properties for dynamically created pages from code on which we don’t have control.
    In our application, we create cq pages dynamically from the code and those pages having child pages nested upto 4-5 levels with specific nodes under jcr:content as well. I want to add indexing for one of the properties in these pages. How can I achieve it?


    • Hi ,
      As long as know the property name, you can define a Lucene / Property index for that path + property combination. Lucene indexes would take some time to refresh automatically while Property index refreshes at the time of page creation.


  20. Hi Hashim,

    Can I know how to control form fields based on selection of a value in dropdown of another field. Actually I found an article in below link which we will be used for controlling fields based on our selection in touch UI dialog (cq:dialog). But in html page, when we are working on form, how can we control some widgets to show and hide based on our selection in dropdown ?

    Example : In sites after selecting a page -> Create workflow -> In “Create workflow” page, If we select our project related workflow from dropdown, I need to display two more fields otherwise I want to hide them.

    The below links explains similar scenario under Touch UI dialog (cq:dialog) but not in Form.
    Please guide !!!


    • HI Hashim,

      can you please help me on below scenario. I have overridden the “create workflow” wizard from
      /libs/cq/gui/content/common/startbulkworkflows to /apps/cq/gui/content/common/startbulkworkflows .
      I added three new properties in the form of wizard and when we are trying to initiate workflow via “Create workflow” on CQ pages, the workflow instance metadata doesn’t stored the newly added three properties data, means those custom properties are not saved under metadata of workflow instance.
      Can you help on where that data is missing, do we need to catch those custom properties on any jsp after posting the form ? or how the scenario is ?

      Please guide !!!

      Ramesh Babu


      • Ideally, it should store the metadata how you are doing it. But if that doesn’t work you can always store the properties on the page jcr: content and retrieve in further workflow steps as per need.


    • Sling Models might not work if the properties are stored as nodes, but it should work if you change your multifield and store properties in a string array. Alternatively, you can use the Post Construct in Sling model to retrieve the node properties instead of direct injection.


    • Hi,
      Once you lock an asset there should be a change of property on that node. “jcr:mixinTypes = mix:lockable” You can utilize that property to identify that asset from visibility based on that particular User session.

      Alternatively what I can think of is you can store that user or user group on that asset properties and while showing that asset in damadmin, perform a check if that user group / user has particular permission or not.


  21. Hi Hashim,

    I have created a simple custom component with dialog having three text fields, As we know the data authored will store under content.
    Now the question is how to replicate the data stored under content to publish environment automatically using sling events and sling jobs ?

    Can you please help me with this ?


  22. Hi Hashim,

    I have created a custom predicate to filter out assets/pages in the pathbrowser. The requirement is i need to get the current page/resource in the osgi service[extending the AbstractNodePredicate] so that based on path the query results will be filtered. Is there any way to get the page/resource/request in the service.


    • Hi,
      In the OSGi service, you can get the reference to repository and resource resolver object. Now it depends on how are you using that service – by some helper class / WCMUsePojo class/ Servlet. From those classes, you can pass the resourcePath as a parameter.


  23. Hi Hashim,
    I want to create a second website in my crxde with different UI. And access the bin/nodeUtility content of the first site’s pages which was already created.Can this be done with MSM.If not what is the option?


  24. Hi Hashim,

    I have created a touch UI dialog which populates dropdown values using datasource. But I don’t want to have ‘n’ no. of datasources doing the same logic, wanted a single datasource and pass some parameter/a key to that datasource ?

    Could you please help.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s