Reputation: 163
I'm trying debug servlet class in aem. But i got problem, breakpoint I check is not working.
Can you please help me in this case ?
Thanks all!
Upvotes: 0
Views: 9384
Reputation: 183
To start an AEM instance in debug mode, you usually have to append (according to Adobe documentation)-
-Xmx512m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
Your start command should then look something like this-
java -Xmx4096m -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -jar <name-of-jar>.jar
In case the debugger is not working, there could be 2 common reasons (and maybe more!)-
-Xmx
- the value might be too low. Increase it to a higher value. I usually use -Xmx4096m
to assign 4GB of memory to my AEM instance.
You've probably skipped all breakpoints. Just go to the debug window in your IDE (Eclipse or IntelliJ) and make sure "Skip all breakpoints" is not active
In case the debugger does not connect, then please check the port. The debug configuration port should match the address=8000
in the start command.
Upvotes: 0
Reputation: 66
Are you sure the doCode() method is being called? Is the log line getting printed?
If yes, it might be possible that you have skipped all breakpoints by going to Run -> Skip all breakpoints
Still doesn't work? Try to build again. If build automatically is turned off, classes may not be refreshed. Code being executed could be different.
Upvotes: 2