Shravan Deolalikar
Shravan Deolalikar

Reputation: 233

Breakpoints/Frames not working in IntelliJ

Hello hoping someone can help me with this. I have a Spring Maven java Rest project I am running in IntelliJ, I just upgraded to the latest version 2016.1. JDK version I am using is 1.7.0_79, Maven v4.0 and I have a Tomcat 7 server. When running the Tomcat server from IntelliJ the debug breakpoints are not catching at all, and I am not seeing any frames. I have tried everything under the sun to try to resolve this, it used to be working but stopped a few days ago. The tomcat starts in both debug, and normal mode with no issue... just does not catch the breakpoints. This is what I have tried

  1. Deleted the entire local git branch and recloned in different location and reopened in Intellij.

  2. File -> Invalidate Caches/Restart

  3. Manually deleting all tomcat server folders and recreating.

  4. Switching the debug configuration, to Shared Memory from Socket and vice versa.

  5. Checked for port conflicts for the socket port..

  6. I have no method level or exception level breakpoints.

If someone could help me develop a step-by-step approach to troubleshooting this that would be great.

Upvotes: 1

Views: 7252

Answers (1)

Software Engineer
Software Engineer

Reputation: 16100

One thing you haven't mentioned, so I think it may be the core of the problem here, is remote debugging...

To debug your code on a server you have to attach your debugger to its debug port. This means starting the server in debug mode, and creating a Remote debugging run configuration in IntelliJ attached to the correct port (which should be reported in your server initialisation logging).

This is because your server is running on a different JVM than the one you're debugging on and in order to debug the two JVMs have to communicate over a tcp/ip port. By setting up a remote debugger you're letting IntelliJ have the information it needs in order to attach to the remote JVM and control it via its debugging interface.

Once you have attached your remote debugger, start it in debug mode and start using your app in a way that triggers code that contains a breakpoint. The server code should stop executing and IntelliJ should show the line the breakpoint occurred on.

Be aware of response timeouts and other such problems when debugging server code. If you have a webapp it may timeout waiting for you to step through your debug session.

Upvotes: 2

Related Questions