`
tonyan416
  • 浏览: 29378 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

Eclipse Debugging Error: ClassNotFoundException的解决办法

阅读更多
用eclipse的时候,遇到一个问题,每次debug的时候,都会第一个弹出这个exception

把ClassNotFoundException:caught and uncaught前面的勾去掉就OK了。

reference:

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 availableI 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 C 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.

今天在做项目的时候,发现项目在
Run as --> Run on server 的时候能正常运行 而在
Debug as -->Debug on server 的时候却不能正在运行 出现类似以上的异常
但是项目的部署 没有错误  而报出异常ClassNotFoundException,
本来使得正常跑 在断点处查看问题,结果一连串的异常处理
解决的办法是:
在 Window -->show view --> Breakpoints 里面
ClassNotFoundException:caught and uncaught前面的勾去掉就OK了

之后 debug模式 正常运行 运行 停止在断点处..
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics