4
votes

Verison Used : IntelliJ IDEA 2020.1.1 (Ultimate Edition)

Deployed application on local tomcat server and debugging by locally hitting the service endpoint through postman. Able to stop thread at breakpoint only for the first time the endpoint is hit. After that IntelliJ just ignores the breakpoint and I receive the response without stopping at any breakpoint. Debug point appears as ticked which means verified-line-breakpoint, still the thread doesn't suspend at breakpoint. Have restart the server for debugger to stop at breakpoints.enter image description here

1
Do you use "Run to cursor" action? In this case see youtrack.jetbrains.com/issue/IDEA-101463 and this comment If issue is different, specify here what Run Configuration do you use? Are these Java sources? Have you verified that code containing the breakpoint is really executed? Check also Tomcat logs and the standard output to check if there are any errors. - Andrey
Yes. I use "Run to cursor". I have tried with both using "Run to cursor" and not using "Run to cursor". facing the same issue either ways. yes its java sources. Which run configuration do you want to check? code execution flow happens through breakpoint. There are no errors in server logs. - Neha Ranjan
@Andrey Thanks! Issue was with "Run to cursor". We should use "Resume" option instead of "Run to cursor". Can you briefly point out the key differences these 2 options have? - Neha Ranjan

1 Answers

4
votes

Got the solution to this issue. While debugging, in order to stop at next breakpoint use "Resume" instead of "Run to cursor". Though for the first API endpoint hit, both these options do the same job but if we want to stop at breakpoint for the 2nd API hit as well, it won't work if "Run to cursor" is used for resuming thread. In that case, we will have to start local server again for application to stop at breakpoint which is frustrating. Adding screenshot for a demo program.

enter image description here