While reading online AEM documents, I came across how to run the AEM on debug mode. But How to debug on remote AEM server ?
3 Answers
To use remote debugging, you must start CQ5 with this JVM parameter: -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
You can add the parameter by doing the following;
Start your server like this: crx-quickstart/bin/start -d --debug-port 8000. The -d parameter adds the jvm parameter to the CQ5 java process.
Add it to your crx-quickstart/bin/start script CQ_JVM_OPTS environment variable (so your server always starts in debug mode).
Include it as a parameter when starting CQ5 with java -jar directly. For example, java -Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar cq-author-4502.jar

- 4,598
- 4
- 33
- 59
Just as you would debug any Java application. Open the AEM in debug mode (i.e. add -debug <your port>
to the startup parameters) and connect to it using your favorite IDE. I don't remember how you do it in Eclipse, but in IntelliJ you just create a new "Remote" run configuration specifying the debugging port.

- 583
- 7
- 16
i am using Intellij, there you can create remote connection for debugging as shown in below screen shot.
1. use the remote server
2. port on which you are running your AEM instance on Debug mode
Done!

- 154
- 1
- 14