I am facing a issue while debugging Java code in IntelliJ.
I am connected to remote server, Am using Maven to build my project and project is building properly, verified it multiple times.
Every time I insert a debug point, IntelliJ returns an error message "there is no executable code at that point". While some breakpoints are inserted, IntelliJ returns a error message while execution "source code doesn't match byte code".
Tried solution provided in various links like : using synchronize options, invalidate caches, rebuilding and others.
From the main menu, select Run | Debugging Actions | Reload Changed Classes.
By default, the Debug tool window opens when your program hits a breakpoint and is not hidden when the session is terminated. To change this behavior, clear the Show debug window on breakpoint checkbox on the Build, Execution, Deployment | Debugger page of the IDE settings Ctrl+Alt+S .
You need to make absolutely sure that the source code you have in IDE corresponds to the classes loaded in the remote JVM.
It could be that you have some extra jar in the classpath with older class versions that overrides the more recent versions or the code is built without debug info, or some annotation processors/obfuscators have changed the target classes during the build process.
Using javap
or a decompiler can help to detect classes that are not in sync.
As you have mentioned in the comment, the code running on the server was from the different git branch than the code you had in IDE. This could be avoided by rebuilding the project in IDE and deploying the actual code to the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With