Search This Blog

Thursday 18 May 2017

Remote debugging in aem


In remote debugging.

1.      Aem forces the jvm to fork a process.

2.      UseSplitVerifier is required for java 7. (Even to start cq normally w/o debug mode.)



Modify start.bat (or create a debug.bat by modifying start.bat)


if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=512M -XX:-UseSplitVerifier -Djava.awt.headless=true
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=30302

OR

if not defined CQ_JVM_OPTS set CQ_JVM_OPTS=-Xmx1024m -XX:MaxPermSize=512M -XX:-UseSplitVerifier -Djava.awt.headless=true
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=30303

OR

start "CQ" cmd.exe /K java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=30302,suspend=n %CQ_JVM_OPTS% -jar %CQ_JARFILE% %START_OPTS%



Or Run from CMD (from the directory where jar is present)


java -jar cq-publish-p4503.jar -XX:MaxPermSize=512m -Xmx1024m
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=30305
-Dsling.run.modes=publish

OR

java -jar cq-publish-p4503.jar -XX:MaxPermSize=512m -Xmx1024m
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=30303
-Dsling.run.modes=publish


For Common Issues in Debugger



2 comments:

  1. This works for local app debugging. What is your suggestion for debugging an aem host on another host (same subnet)?

    ReplyDelete
    Replies
    1. hi David, For debugging AEM on a remote host, instead of adding localhost in the remote debug configs in whatever IDE you are using, Just add the IP of the remote machine and the port on which aem is running.

      Delete