ClassNotFoundException [sv]

Eclipse Debugging Error: ClassNotFoundException

I just hit a really annoying (sort of) bug in Eclipse. I could not debug any of my projects because they immediately stopped with a call stack like the following:
terrain.TerrainApp at localhost:49827
Thread [main] (Suspended (exception ClassNotFoundException))
ClassLoader.findBootstrapClass(String) line: not available [native method]
Launcher$ExtClassLoader(ClassLoader).findBootstrapClass0(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
Launcher$AppClassLoader(ClassLoader).loadClassInternal(String) line: not available

I found people with similar issues on various message boards, but no solutions.

Then I figured out that if I kept hitting continue (to go past the breakpoint) it would eventually reach my actual application. Along the way though, java was triggering ClassNotFoundExceptions for every single class referenced in my code, which was causing Eclipse to break. It turns out that these ClassNotFoundExceptions are normal behavior – they are supposed to happen for every new class, but having eclipse set a breakpoint for each one is definitely not!

To solve the problem, I had to open up the breakpoint window and disable the breakpoint “ClassNotFoundException: caught and uncaught” — I have no idea how this breakpoint got set in the first place, I certainly didn’t do it!

So now I can finally debug my programs without relying on tons of print statements… that should help my progress.

发表评论