Saturday, December 16, 2023

Run Adobe AEM in Debug Mode | Debugger in AEM VsCode

 

Run AEM In Debug Mode









Using IntelliJ

Command 

Run the author instance in debug mode by executing the following command and Please make sure to replace aem-author-p4502.jar with the appropriate filename if necessary. This command starts the author instance with debugging enabled on port 8888.

java -Xmx2048M -agentlib:jdwp=transport=dt_socket,address=8888,
server=y,suspend=n -jar aem-author-p4502.jar

Configure IntelliJ for debugging:

  •  Open your project in IntelliJ.
  •  Navigate to the "Run" menu and select "Edit Configurations".
  •  Click on the "+" button to create a new configuration and choose "Remote JVM Debug" from the list.
  •  In the "Name" field, provide a name for your configuration (e.g., AEM Debug).
  •  In the "Debugger mode" section, select "Attach to remote JVM".
  •  Specify the following settings:
  • Host: The hostname or IP address of your Slack workspace's server where AEM is running.
  • Port: The port number where AEM is running in debug mode (in this case, 8888).
  • Optionally, you can configure other settings such as module filtering, breakpoints, etc., as per your requirements.
  • Click "OK" to save the configuration.


you can start a debugging session by selecting the created configuration and clicking the "Debug" button in IntelliJ.





Using VSCode

Command 

Run the author instance in debug mode by executing the following command and Please make sure to replace aem-author-p4502.jar with the appropriate filename if necessary. This command starts the author instance with debugging enabled on port 5000 (this port could be anything).

java -jar aem-author-p4502.jar -debug 5000

After running above command Now Configure VSCode for debugging
  • Click on  Debug Icon and make configuration in launch.json file according to project
Run your debugger by clicking on debugger green button debugger will be started




  • Now you can see debugger is telling you at which break point what is happening
  • Now you can see debugger is telling you at which break point what is happening
  • Now you can see debugger is telling you at which break point what is happening
  • Now you can see debugger is telling you at which break point what is happening
Add Breakpoints on any "sling model" that you want to debug. and after that refresh you page on aem author that is using this model.





Now Debugger is Telling you at which breakpoint what is happening





Previous Post
Next Post

post written by:

0 comments: