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 .

Hashim

703 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) {
    requestSession.logout();
    }

    But while doing it I’m getting below error.

    org.apache.sling.engine.impl.SlingRequestProcessorImpl 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…

    Thanks,
    Srikanth

    Like

  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.

    Like

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

      Like

  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.

    Like

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

      Like

  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 https://helpx.adobe.com/experience-manager/kb/ThreadPoolLimitReached.html link where they have mentioned that in such situations we can increase the default value of
    128

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

    Regards
    NavinKumar KB

    Like

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

      Like

  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?

    Like

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

      Like

  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?

    Like

  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

    Like

  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 ?

    Liked by 1 person

  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?
    -Ekta

    Like

  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.

    Like

  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 – https://forums.adobe.com/thread/2321917), 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

    Like

  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?

    Like

  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.

    Like

  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\
    mph_Dam2.zip” -F name=”mph_Dam2″ -F force=true -F install=true http://localhost:
    4502/crx/packmgr/service.jsp

    +————+—————————————–+
    | 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’ |
    +————+—————————————–+

    ok

    WHEN I UPLOAD SMALL PACKAGE:
    C:\Users\gopinath.m>curl -u admin:admin -F file=@”C:\Users\gopinath.m\Downloads\
    mph_Dam1.zip” -F name=”mph_Dam1″ -F force=true -F install=true http://localhost:
    4502/crx/packmgr/service.jsp

    my_packages
    Mph_Dam1

    Mph_Dam1.zip
    9950

    gopinath.m

    gopinath.m

    null

    Installing content…
    Creating snapshot for package my_packages:Mph_Dam1
    A META-INF
    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 -> http://www.jcp.org/jcr/nt/1.0
    – sling -> http://sling.apache.org/jcr/sling/1.0
    – 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.

    ok

    Like

  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
    “https://docs.adobe.com/docs/en/cq/5-6-1/dam/metadata_for_digitalassetmanagement.html#Creating 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,
    Ramesh

    Liked by 1 person

    • Hi,
      Please take a look at these paths for such customizations :
      /libs/wcm/core/content/editor/jcr:content/content/items/content/content/items/startworkflowmodal
      /libs/cq/gui/components/authoring/workflow/startworkflow

      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.
        https://helpx.adobe.com/experience-manager/using/dynamic_touchui.html
        Please guide !!!

        Like

  17. Hi Hashim,
    We are using runmode (author, author.prod, author.qa, 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

    Like

  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?

    Like

  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?

    Like

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

      Like

  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.
    https://helpx.adobe.com/experience-manager/using/dynamic_touchui.html
    Please guide !!!

    Like

    • 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 !!!

      Regards,
      Ramesh Babu

      Like

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

        Like

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

      Like

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

      Like

  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 ?

    Like

  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.

    Like

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

      Like

  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?

    Like

    • Hi,
      If both the sites land in one AEM environment, there shouldnt be a problem to access /bin paths. You might not need any MSM for this. Just make sure the dispatcher filters are correct for both the sites vhosts.

      Like

  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.

    Like

  25. Issue: Videos are downloading instead of playing directly in browser.

    Videos from dam path are downloading when accessing them using dispatcher but if we access same videos with publisher directly it is playing perfectly in browser.

    As per below helpx URL we added all client headers in dispatcher except “Accept-Ranges none”. We are not sure where to add this entry. when I try to add it in httpd.conf top and it is saying syntax error.

    https://helpx.adobe.com/experience-manager/kb/Omitting-Content-Length-header-breaks-video-playback-in-some-browsers-AEM-Dispatcher.html

    Like

  26. Hi Hashim,

    i have one requirement related RTE.

    I have list of some unicodes corresponding to icons [Ex: u23\12 tends to some glyph icon]. I need to add these all unicodes as a dropdown in RTE and enable to include where i want in my RTE text. is it acheivable? if yes, can you tell me how this can be done? or any aleternative? please suggest

    Thanks
    Mujafar

    Like

  27. Hi Hashim,

    I have a requirement to restrict Users from dragging and dropping an image which exists outside of the DAM.For this purpose i am using this property: allowUpload=”{Boolean}false”. But when i drag and drop an image from my local, it is getting uploaded there and it is coming on page too.

    Thanks
    Ravi

    Liked by 1 person

  28. Hi Hakim ,

    I am trying to use Prosper to mock AEM jcrcontent for my test cases and facing issues with it .Do you suggest me to go with Propser or can you please share some tutorials for mocking using Spock framework.I did some reaserch but all are ending up in not able to mock JCR nodes.You advice is much appreciated.

    Like

  29. Hi Hashim,

    I want to know how we can monitor user activities in aem when they are working on content and assests like edit, move, delete and rename.

    I seen there is 2 use cases to track the user activities
    1. In crx/de we can get the data from var/audit
    2. We can enable audit log from osgi config

    I want to know if we have any other way to monotoe the activities .

    Please let me know if above 2 situation are true or nor. Can you give me an idea about this problem.

    Like

  30. Hi Hashim,

    I am using Font Awesome icons from acs-aem commons. I am able to add these icons to my widget and using perfectly. But if i want to use or include in rich text editor how can i do? i want to add this icon in my rte text.

    Thanks
    Mujafar

    Like

  31. Hi Hashim,

    I want to know how we can monitor user activities in aem when they are working on content and assests like edit, move, delete and rename.

    I seen there is 2 use cases to track the user activities
    1. In crx/de we can get the data from var/audit
    2. We can enable audit log from osgi config

    I want to know if we have any other way to monotoe the activities .

    Please let me know if above 2 situation are true or nor. Can you give me an idea about this problem.

    Like

  32. Hey Hashim,

    I have a sling servlet which works fine in the author instance but returns 404 in the publisher instance, I am using AEM 6.3. I have been blocked on this for a while, can you please help.

    Regards,
    Prakash Iyer

    Like

    • Hi Prakash,
      Are you able to see that sling servlet in OSGi components? Are there any loggers on Publish? It could be a permissions issue too.
      You can also use AEM debugging mode to check if the flow of code reaches your servlet.
      Try to check these for debugging.

      Like

  33. Hi Hashim,

    Can you have me to find solution to show width and height dimensions when cropping image (when we select via Free hand, or the ratios)? How can I do that if I don’t want to customize AEM libraries?

    Thanks a lot,
    Lena

    Like

    • Hi,
      In all these cases you can find out the servlet from this tool /system/console/servletresolver
      In this case, as it uses impersonator.json you will get this –
      com.adobe.granite.security.user.internal.servlets.ImpersonationServlet
      org.apache.sling.servlets.get.impl.DefaultGetServlet
      org.apache.sling.jcr.webdav.impl.servlets.SlingWebDavServlet

      Like

  34. Hi Hashim,
    I am working on dialog, if user click on addfield button, should be added items on the dropdown list. But in my case it doesn’t show up first time. it is showing if i open dialog 2nd time.

    Touch UI multifield component.

    Like

  35. Hi Hashim,

    iam new to AEM,
    using AEM 6.1, iam unable to publish the pages even my default replication agent is configured correctly.
    getting queue is blocked.
    i tried all mentioned in https://helpx.adobe.com/experience-manager/kb/replication-stuck.html

    if i click test connection iam getting:Replication test to localhost:4503/bin/receive.

    in logs i can see this error:ERROR – publish : Error during replication com.day.cq.replication.ReplicationException: Unable to replicate content with no transport handler. Check configuration.

    could you please help here.

    Like

  36. Hi Hashim
    I found this blog interesting, thought to check my query on this. Actually , I have two groups and each has one member. Each group has its own branch access and denied of another. When user of one group tries to access resources of another group , am getting 404 and user has succesful access to resources which belongs to his group. Is this expected behavior? 404 instead of 401 or 403? I posted the same thing on blog,
    https://forums.adobe.com/thread/2322366?start=0&tstart=0 but no insight if the behavior is expected or not.

    Like

  37. Hi Hashim,

    I cam here as another techie looking for answers. And I have to thank you from the deepest corner of my heart for all the amazing work you are doing!! You’re helping out random people painstakingly. This shows your mettle, man. You’re awesome!! :)

    Second, I’m stuck with this issue-

    i have a custom column control.But whenever I click on its paragraphs, a pop up appears on the top “ERROR Paragraph move operation failed”.
    REMEMBER, I only CLICK on the paragraph. I dont move the components.
    The console shows a 500 ERROR.
    Logs-
    POST /content/customerportal/oc/au/en/medicine-and-resources/cotellic/jcr:content/columncontrol/par_1/ HTTP/1.1] org.apache.sling.servlets.post.impl.operations.ModifyOperation Exception during response processing.
    javax.jcr.RepositoryException: Cannot move node at /content/customerportal/oc/au/en/medicine-and-resources/cotellic/jcr:content/columncontrol to /content/customerportal/oc/au/en/medicine-and-resources/cotellic/jcr:content/columncontrol/par_1/columncontrol

    Any suggestions on how to work on this?

    Like

    • Hi,
      From the error logs it seems like there is some problem with the move function. Check the node structure and its permissions for the user trying move operation. Try to add console logs in your custom column control.

      Like

      • Hi Hashim,

        Thanks for the reply :)

        It definitely was a problem with the node. More specifically, node property.
        In the cq:editConfig nod, I had misspelled the word “move” . Hence the error.

        Thanks for all your work man :)

        Keep being awesome!

        Liked by 1 person

Leave a reply to Hashim Khan Cancel reply