Namastey,
There are situations when you want to do debugging of OSGI java code while it is running on your AEM.
There are two parts to it :
java -Xmx2g -agentlib:jdwp=transport=dt_socket,address=5402,server=y,suspend=n -jar cq-author-p4502.jar
Dhanywad
There are situations when you want to do debugging of OSGI java code while it is running on your AEM.
There are two parts to it :
- AEM server should be enabled to accept remote debugging connection
- Eclipse IDE / Intellij should be configured to make remote debugging connection to AEM
Start AEM JAR with following command
java -Xmx2g -agentlib:jdwp=transport=dt_socket,address=5402,server=y,suspend=n -jar cq-author-p4502.jar
-Xrunjdwp loads the JPDA reference implementation of JDWP
- transport-dt_socket is the name of the transport to use in connecting to debugger
- server=y > means listen for a debugger application to attach
- address=5402 > means listen for a connection at this address (no host = this port on add interfaces)
- suspend=n > means do not wait for a debugger to attach
Add Debug Configuration in Eclipse
- click on debug configuration
- Select Remote Java Application
- Add Configuration
- In the new configuration, select project and provide aem host and aem port
Now setup some break points in java code ( except JSP)
Run your program and eclipse should ask you to enter debug mode.
Dhanywad