NetBeans和停止所有例外/休息? [英] NetBeans and stop/break on all Exceptions?

查看:231
本文介绍了NetBeans和停止所有例外/休息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以使用NetBeans作为我的IDE开发Android林。

So Im using NetBeans as my IDE for developing Android.

然而,当我得到一个异常,Netbeans的不上除了打破,因为我希望它。

However, when I get an exception, Netbeans does not break on the exception as I expect it to.

我检查了盒子停止对未捕获的异常,可以中找到的选项 - > Java调试 - >停止对未捕获的异常的,但是这并不能帮助

I have checked the box "Stop on uncaught exceptions" that can be found in Options --> Java Debugger --> Stop on uncaught exceptions but that doesn't help.

此外,我在这里可以看到实际的异常消息?我没有看到任何东西。现在我不知道何时何地发生异常,只是它确实发生了。

Furthermore, where can I see the actual exception message? I dont see anything. Right now I have no clue where and when an exception occurs, just that it does occur.

我读过一些关于netbeans.org(缓存,该网站似乎是向下)有关固定在6.9.1中的错误,但它不似乎定格在7.0,我有。

I've read some on the netbeans.org (cached, the site seems to be down) about a bug in 6.9.1 that was fixed, but it doesnt seem to be fixed in 7.0 that I have.

调试窗口犯规说什么都有益,给人某种形式的AV堆栈跟踪这是毫无意义的因为它没有指定任何我自己的code。

The debugging window doesnt say anything useful at all, gives some form av stacktrace that is pointless as it doesnt specify any of my own code.

我从Eclipse的原因切换的IDE很烂,NetBeans是更为精简,但调试需要固定是有用的......

I switched from Eclipse cause that IDE sucks, NetBeans is much leaner, but the debugging needs to be fixed to be useful...

推荐答案

我有这样的问题,当我使用NetBeans了。为了获得异常消息,我用试一收。在catch()语句,调用包含一些code函数,并把一个断点就可以了。然后,当异常给你的断点在catch语句将被调用,你可以阅读从异常obect信息(错误信息,栈,等等)。

I have this problem when I use netbeans too. To get the exception message, I use try-and-catch. In the catch() statement, call a function that contains some code and put a breakpoint on it. Then when the exception is given your breakpoint in the catch statement will be called and you can read the information (error message, stack, etc.) from the Exception obect.

try
{
    // Doing something here
}
catch (Exception e1)
{
    // This is called when an exception occurs
    doSomething();   /// Put breakpoint here
}

更新:

我不知道这是否会工作的机器人,但你可以尝试进入新建断点。当进入一个新的断点打破例外,你需要知道的 确切的包/类异常名称。例如,如果你想赶上一个 NullPointerException异常,那么你去调试>>新建断点创建一个新断点,然后输入 显示java.lang.NullPointerException到的异常类名称字段 断点属性对话框。选择是否打破抓,未捕获或两者的异常,如果这类型的异常以往任何时候都发生在类/项目将打一个断点。

I am not sure if this will work for android but you could try entering a "New Breakpoint". When entering a new breakpoint to break on an exception, you need to know the exact package/class exception name. For example, if you want to catch a NullPointerException, then you go to Debug >> New Breakpoint to create a New Breakpoint and enter java.lang.NullPointerException into the Exception Class Name field in the Breakpoint Properties dialog. Choose whether to break on caught, uncaught or both, exceptions and it will hit a breakpoint if that type of exception ever occurs in the class/project.

这篇关于NetBeans和停止所有例外/休息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆