How do we debug our application running in a remote (or local) AEM server?
To debug an AEM application, you can use java remote debugging.
Warning: Do not enable remote debugging in your production environment unless it necessary as it could greatly affect your application performance.
Step 1: Add the Remote Debugging JVM Parameter
To use remote debugging, you must start AEM with this JVM parameter:
-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
You can add the parameter by doing any of the following:
crx-quickstart/bin/start
script CQ_JVM_OPTS
environment variable (so your server always starts in debug mode).java -jar
directly. For example, java -Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar cq-author-4502.jar
Notes
Step 2: Start a remote debugging session
To start a remote debugging session from Eclipse, do the following: