AEM 61 - This And That


1)  In AEM <= 6.0 the compiled classes are placed in CRX /var/classes - http://localhost:4502/crx/de/index.jsp#/var/classes. To force recompile any jsp files, deleting the node in /var/classes helped; with AEM 61, the compiled class files are NOT placed in /var/classes any more, so to recompile jsps, use Felix Console - http://localhost:4502/system/console/slingjsp or to be 100% sure to the naked eye, follow these steps

             a. Stop bundle
             b. Search with keyword classes in CQ install folder <author>\crx-quickstart\launchpad\felix
             c. Delete generated java/class files from <author>\crx-quickstart\launchpad\felix\<bundleXYZ>\data\classes
             d. Delete generated java files from /var/classes in CRX (sightly generated java files are placed here)
             e. Restart bundle


2)  OSGI action when updating packages in AEM. Packages with SNAPSHOT in name have special meaning; SNAPSHOT packages are only for Dev environment. Thanks to Ian Boston for the tip

Current VersionNew VersionAction
1.0.23-r2314234231.0.23-r231423424Install (last digit 4 > 3)
1.0.23-T1r2314234231.0.23-T2r231423423Install (Patch revision number - T2r > T1r)


3)  By default, only administrators can view all workflow instancesto add users/groups for administering workflows (view, terminate, monitor workflows created by other users), give necessary read/write permissions on /etc/workflow/instances and add user/group to Superuser of Adobe Granite Workflow Service - http://localhost:4502/system/console/configMgr/com.adobe.granite.workflow.core.WorkflowSessionFactory

4)  By default, when html tags like hyperlink from an external website are copied into Rich Text Editor (not source edit mode) all attributes are NOT copied (so you may only see href copied and not others ). To copy other attributes like say class, role etc. htmlPasteRules have to be defined in the edit plugin of RTE. For more options check the documentation

To copy css classes, make sure cssMode is defined

5)  To know the hotfixes and feature packs installed on AEM 

curl -u admin -s http://localhost:4502/crx/packmgr/list.jsp | jshon -e results -a -e downloadName -u | grep -E "hotfix|feature"

Sample output:

6)  In order to reduce time spent on offline compaction, make sure the customer has latest Oak version and also they use memory mapped file access option with compaction command.  Since memory mapped file access would use off-heap memory, it would benefit to have high memory on the server - thanks Can Altuner for the tip

java -Dtar.memoryMapped=true -Dupdate.limit=5000000 -Dcompaction-progress-log=1500000 
     -Dcompress-interval=10000000 -Doffline-compaction=true -Xmx8G -jar oak-run-1.2.7.jar 
     compact /crx-quickstart/repository/segmentstore

7)  To validate user's password during reset or while creation, use password validation action of Authorizable Action Provider - http://localhost:4502/system/console/configMgr/

For detailed error description on Touch UI - check this post, Classic UI - check this post


TouchUI Error

ClassicUI Error

8)  When a 300 Multiple choices status code is returned by json renderer of GET servlet, try changing your application logic or increase the JSON Max Results of Apache Sling GET Servlet - http://localhost:4502/system/console/configMgr/


9)  CRXDE Lite Tools -> Query provides interface for running search queries; if a query is running for long time (could be because of missing index) and consuming system resources, the following Traversing Cursor warnings are logged in error.log

29.02.2016 11:48:22.174 *WARN* [0:0:0:0:0:0:0:1 [1456768102069] GET /bin/querybuilder.json HTTP/1.1] org.apache.jackrabbit.oak.spi.query.Cursors$TraversingCursor Traversed 12000 nodes with filter Filter(query=select [jcr:path], [jcr:score], * from [nt:base] as a where [modelId] = '/etc/workflow/models/request_for_activation/jcr:content/model' and [data/payload/path] = '/content/dam/geometrixx/portraits/alison_parker.jpg' and isdescendantnode(a, '/etc/workflow/instances') order by [endTime] desc /* xpath: /jcr:root/etc/workflow/instances//*[@modelId = '/etc/workflow/models/request_for_activation/jcr:content/model' and data/payload/@path = '/content/dam/geometrixx/portraits/alison_parker.jpg'] order by @endTime descending */, path=/etc/workflow/instances//*, property=[modelId=[/etc/workflow/models/request_for_activation/jcr:content/model], data/payload/path=[/content/dam/geometrixx/portraits/alison_parker.jpg]]); consider creating an index or changing the query

To kill such queries without restarting CQ

       a. Access QueryEngineSettings MBean - http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dsettings%2Ctype%3DQueryEngineSettings
       b. Set the values LimitInMemory and LimitReads to some lower number like 10000
       c. Queries that exceed one of the limits are cancelled with an UnsupportedOperationException

To automatically kill long running queries - set the startup system properties -Doak.queryLimitInMemory and -Doak.queryLimitReads to some lower number like 10000 (requires restart)

For more information check and

10) To workaround, increase the Number of Calls per request - sling.max.calls, setting of Apache Sling Main Servlet http://localhost:4502/system/console/configMgr/

`27.01.2016 15:29:50.021 *ERROR* [0:0:0:0:0:0:0:1 [1453930186556] GET /apps/geometrixx/components/testComponent/_cq_dialog.html/content/geometrixx/en/jcr:content/par/testComponent HTTP/1.1] service: Uncaught SlingException /libs/granite/ui/components/foundation/form/fieldset/fieldset.jsp

11)  To find the jar file in cq install folder, containing a specific class - look for the bundle id folder


1 comment:

  1. Using screenshots, explaining very well but i need more, can u present me from the basics.

    Java Training in Chennai