views:

160

answers:

2

In eclipse I am writing some code that crawls a specific webpage and downloads an applet, which it then adds to a JFrame and executes. If I run program without adding any breakpoints, it works perfectly. It loads the applet, and it begins running. However, if I add a breakpoint to the applets update(Graphics g) method, it simply stops refreshing. This is expected, obviously, but it never actually trips the breakpoint.

I know breakpoints are working in general with my setup, and in fact if I add a breakpoint to the paint(Graphics g) method of the exact same applet, it will trip whenever you would expect it to.

The only thing that is slightly unconventional about this is that I don't have the source of the applet which I am displaying. Instead, I simply set a breakpoint on the method entry.

If I disable the breakpoint while the applet is running, it resumes painting, but if I enable it again, it won't always stop repainting.

I don't know if this could somehow be the expected behavior of eclipse/jvm, or if I have found a bug. If it is a bug, is it a bug in eclipse or the jvm?

+1  A: 

Just a suggestion: could you check what version of the JVM you are executing your applet with?

There were mentions of troubles with breakpoints (also detailed here) and the latest jdk6.0_u14,
so if you are using this version, you may want to check if the same behavior is observed with 6.0_u13.

VonC
I am actually usingjava version "1.6.0_0"OpenJDK Runtime Environment (IcedTea6 1.5) (6b16-4)OpenJDK Client VM (build 14.0-b15, mixed mode, sharing)So I am not sure what version that corresponds to in the sun releases (I see 14, 15, and 16 in in the version numbers)Either way, I will try installing an older version (Probably java 5) and see if I still get the bug.
Jeremybub
And Java 5 gets the same error.I think the problem might be that I am putting the breakpoint in a local copy of the jar, but actually loading the class from a URLClassLoader.
Jeremybub
Nope, using a local copy, I am getting the same problem, but upon further inspection, it seems that it is not entirely stopping painting, just there is a huge lag. Perhaps somehow adding a breakpoint is slowing it enormously.
Jeremybub
A: 

Have a look at the debug panel showing your threads. It might well be another thread than you expect that breaks on the breakpoint.

Thorbjørn Ravn Andersen
Yeah, I always look, no thread breaks.
Jeremybub