How to enable Debug mode in AEM & find unclosed Sessions

Issue : 

           Debug Mode

Solution :


  • In order to enable the session debug-mode.
  • Add following JVM parameter to start.sh or start.bat before you restart the AEM server.
                         -Dcrx.debug.sessions=true
Note: 
  • Stop AEM server if enough staktrace is gathered.
  • Remove the above JVM parameter from start.sh or start.bat file

Downlaod the log analyser Jar file:


Then run the attached jar-file with following command:

  • java -jar session_analyzer.jar | sort > output.txt
This will generate a new file output.txt that contains the stack trace of unclosed sessions, The session id is at the end of the line.
Example:
com.day.crx.j2ee.JCRExplorerServlet.login(JCRExplorerServlet.java:521)

    ResourceServlet.spoolResource(ResourceServlet.java:148)

    java.lang.Thread.run(Thread.java:595): session# 10023

This example means session #10023 was not closed, and the stack trace included the given lines when the session was opened. Based on this output you should be able to find the defect code location and fix the problem

No comments:

Post a Comment