Setup Debugging in AEM dev instance

Here we will explain the steps that is required for debug setup in dev environment

Step 1: Add the Remote Debugging JVM Parameter

  1. To use remote debugging, you must start AEM with this JVM parameter: -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

  2. You can add the parameter by doing any of the following:

  • 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 AEM with java -jar directly. For example, java -Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar cq-author-4502.jar

Step 2: Start a remote debugging session

To start a remote debugging session from Eclipse, do the following:

  1. Open Eclipse.

  2. Choose Run > Debug Configurations.

  3. Right-click Remote Java Applications and select New.

  4. Select your AEM project under Project.

  5. Type in the port from the "address" configuration of the jvm parameter defined above. In the example, it is port 8000 (and the hostname of the machine you are connecting to, most likely localhost)

  6. To start a debugging session, double-click your new configuration in the Debug Configurations screen after saving it.

That's it you have a debug setup in your dev environment. Now you can run debug in IDE and start your AEM instance in debug mode, then you will be able to start the debugging. For other IDE you might have to add different setup like in Intelij you might need to add debug from add configuration and adding remote app in it.

60 views0 comments

Recent Posts

See All

GraphQL - A query language for API - Part 1

Have you recently started hearing about GraphQL and wondering what is it all about? Here is a short introduction to get you up to speed. So, lets start with What is GraphQL? In simple words, its a que

"this" in javascript

Here we will talk about this keyword in javascript and how it is different from any other javascript object. "this" is and current context object in runtime engine, but unlike any other object the pro