IntelliJ connects to JVM (debug mode) but breakpoint is not hit nor confirmed (ticked)

Answered

Some system info:

IntelliJ IDEA 2020.1 (Community Edition)
Build #IC-201.6668.121, built on April 9, 2020
Runtime version: 11.0.6+8-b765.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Registry: decompiler.dump.original.lines=true
Non-Bundled Plugins: org.jetbrains.kotlin

==== The problem

If I put a breakpoint in one of the decompiled classes that are part of the libs in my project, the breakpoint works and is ticked right away. The below (1) is what I see in my debug console, after adding

-Didea.debugger.trace="SENDS RECEIVES"

However, if I put a breakpoint in one of the java files that are actually part of my project (and that extend a class in my libraries), then the breakpoint doesn't work and is not ticked. (2) is what I see in the logs.

I have tried changing the structure of my modules and playing with the output path. Nothing worked. By the way, compiling the changed class or rebuiding the project after a change in a java also output "0 classes reloaded", and I've checked the flag "Generate Debugging Info" is ticked for the Java Compiler.

Any help would be greatly appreciated!

 

(1) This is the log when it works

[JDI: Sending Command(id=31155) JDWP.EventRequest.Set]
[JDI: Sending: eventKind(byte): 2]
[JDI: Sending: suspendPolicy(byte): 2]
[JDI: Sending: modifiers(Modifier[]): ]
[JDI: Sending: modifiers[i](Modifier): ]
[JDI: Sending: modKind(byte): 7]
[JDI: Sending: loc(Location): psdi.app.assetcatalog.AssetCatalogService:1886]

(2) This is the log when it doesn't work

[JDI: Sending Command(id=31205) JDWP.EventRequest.Set]
[JDI: Sending: eventKind(byte): 8]
[JDI: Sending: suspendPolicy(byte): 1]
[JDI: Sending: modifiers(Modifier[]): ]
[JDI: Sending: modifiers[i](Modifier): ]
[JDI: Sending: modKind(byte): 5]
[JDI: Sending: classPattern(String): com.ibm.gbs.app.assetcatalog.GBSAssetCatalogService]

0
9 comments

Could you please provide a demo project, to reproduce a problem?

0
Avatar
Permanently deleted user

I've tried to create a dummy project with a similar structure & concept (https://gofile.io/?c=tNujQ0) - no luck, it works in that one. :(

Is there any other logging info I can include that would help?

 

0

First please check that the class you're trying to set breakpoint at is in the project source roots or a dependency.
To verify it - try "go to class" action with the class name.

0
Avatar
Permanently deleted user

This is what I see with the go to class action (ctrl-n)

 

Wouldn't the compiler fail if the class imported at the wrong root...? Also, wouldn't the log above also print something different? These are rethorical questions, just trying to brainstorm the problem...

0
Avatar
Permanently deleted user

By the way, I am happy to have a webex session with screen share over this problem, if you're up for it.

0

Please check that the module (businessobjects) is visible from the run configuration classpath. How do you start the debug?

0
Avatar
Permanently deleted user

Should be, see below "use module classpath"

 

0

please try to set a method breakpoint in that file on any method that is really called. Could that be that debug info is not available in that file?
Try to set breakpoints on other lines in that file.
Also try to step into that file from some other place where you can stop in the debugger.

0
Avatar
Permanently deleted user

I finally found out what the problem was. The problem was the application was picking up another class somewhere else, at runtime - so this class was not even loaded by the classloader.

Thanks for your help anyway, as our discussion here guided me in the right direction. Debugging is now working and the breakpoints are being ticked and hit as expected.

0

Please sign in to leave a comment.