Community
Participate
Working Groups
From bug 140478: "First, sometimes I place a breakpoint and it is not being hit. I have a println() statement that executes (I see the output), but when I set a breakpoint at that line, nothing happens. Other breakpoints that I have set earlier are being hit. Restarting the debug session solved it."
Reported against 3.2RC3. Do you have a test case for this? Had any hot code replace been performed on the target VM? Had any hot code replace operations failed?
*** Bug 140478 has been marked as a duplicate of this bug. ***
It is reproducible, I'll try to build a small test case. I use hot code replace a lot, but it hasn't failed (the println() statement was added with hot code replace, but the bug occurs even on fresh runs).
*** Bug 142473 has been marked as a duplicate of this bug. ***
Genady, have you been able to reproduce this in the 3.2.1 maintenance stream?
I switched back to 3.1.2 hoping to avoid this bug, but the same bug occurs in 3.1.2. Although I feel it doesn't occur that often, but I can't prove it so maybe I'm wrong. It seems that breakpoints are missed most often when I run JUnit testcases. So sometimes if I want to debug something I write a main() function and use that as a workaround.
Thanks for reporting back - I have still not seen this. When it happens next time - ensure you are in debug mode, and ensure that the "skip breakpoints" toggle (in the breakpoints view) is not "on". Also ensure that your breakpoints appear as "installed" (i.e. with a check mark besdie them).
I haven't seen it recently (still using 3.2). I'll update to 3.2.1 next week and check all these bugs.
I have experienced the problem a couple of times again, and have checked thoroughly that: - the breakpoint is installed/enabled in the breakpoints view; - I have not been doing hot code replace; - there was not another instance of my testcase running at the same time As I mentioned earlier, a workaround that succeeds 100% of the times is not to debug my testcase using JUnit, but writing a main() function just for debug purposes. I'm just thinking what the cause of this problem might be; my JUnit testcases depend on a couple of projects; all of them depend on (their own) junit jars. Could that perhaps be part of the problem? I tried to remove all redundant junit jars from the classpath but it didn't help. But maybe I forgot some reference somewhere? Still it is strange that the same breakpoint is sometimes hit and sometimes missed.
There may be an issue if you place a breakpoint in a class for which there are several instances on the runtime classpath. I.e. the source that you place the breakpoint in may not match the class file loaded at runtime, depending on your classpath order. So, the breakpoint appears loaded/installed, but does not get hit because line numbers do match up as you think they should. Strange that using a main() vs JUnit makes the problem go away. I have no explanataion for this, and have not experience the problem yet.
Based on comment#9 in bug bug 142473, and comment #8 in this bug, marking as works for me.