views:

89

answers:

3

I am debugging some Java code with Eclipse 3.4.2. I have disabled all the breakpoints, yet the debugger still stops at a specific line. This point is several lines before a null pointer exception is triggered. Curiously, when I run the same code/run configuration, but not in the debugger, the null pointer exception does not occur.

Also, if I step through this code from the beginning of the method causing the null pointer exception, using the exact same input, there is no problem. It only occurs when I remove all breakpoints but Eclipse decides to stop there regardless.

Why could this be happening?

+2  A: 

Eclipse also supports exception break points (which stop your program when a certain exception is thrown). You can see them in the "Breakpoints" panel of the debugger. In your case, this could be a ClassCastException, for example.

If that panel is empty, then it can be a bug in your Java VM or maybe you have two processes open in the debugger. If all else fails, try to debug it in Eclipse 3.5.1.

Aaron Digulla
A: 

Why could this be happening?

An infinite loop in your code?

BalusC
no. it's stopping as if at a breakpoint; not being unresponsive.
Rosarch
+1  A: 

I've encountered this as well and have yet to find a satisfactory answer. Try doing a workspace refresh, full rebuild and restart Eclipse.

At least one of those suggestions will help.

Failing that - rebuild or restore your workspace (I always keep a backup)

Fortyrunner