Java 在GWT 2.7超级开发模式下调试时,是否缺少stackTrace?
我刚刚从GWT2.5.1迁移到2.7,这是我第一次使用SuperDev模式。 我已经在Chrome开发工具中启用了“JavaScript源映射”。 在Chrome控制台中,异常如下所示:Java 在GWT 2.7超级开发模式下调试时,是否缺少stackTrace?,java,gwt,Java,Gwt,我刚刚从GWT2.5.1迁移到2.7,这是我第一次使用SuperDev模式。 我已经在Chrome开发工具中启用了“JavaScript源映射”。 在Chrome控制台中,异常如下所示: com.google.gwt.event.shared.UmbrellaException: Exception caught: For input string: "a" at fillInStackTrace_0_g$ at Throwable_3_g$ at Exception_3_g$
com.google.gwt.event.shared.UmbrellaException: Exception caught: For input string: "a"
at fillInStackTrace_0_g$
at Throwable_3_g$
at Exception_3_g$
at RuntimeException_3_g$
at UmbrellaException_3_g$
at UmbrellaException_5_g$
at fireEvent_1_g$
at fireEvent_3_g$
at fireNativeEvent_1_g$
at onBrowserEvent_2_g$
at dispatchEventImpl_0_g$
at dispatchEvent_4_g$
at dispatchEvent_6_g$
at apply_0_g$
at entry0_0_g$
at <anonymous>
Caused by: java.lang.NumberFormatException: For input string: "a"
at fillInStackTrace_0_g$
at Throwable_2_g$
at Exception_2_g$
at RuntimeException_2_g$
at IllegalArgumentException_2_g$
at NumberFormatException_2_g$
at forInputString_0_g$
at __parseAndValidateDouble_0_g$
at parseDouble_0_g$
at Double_2_g$
at valueOf_68_g$
at onClick_109_g$
at dispatch_6_g$
at dispatch_7_g$
at dispatch_1_g$
at dispatchEvent_2_g$
at doFire_0_g$
at fireEvent_2_g$
at fireEvent_1_g$
at fireEvent_3_g$
at fireNativeEvent_1_g$
at onBrowserEvent_2_g$
at dispatchEventImpl_0_g$
at dispatchEvent_4_g$
at dispatchEvent_6_g$
at apply_0_g$
at entry0_0_g$
at <anonymous>
我怎样才能找到stackTrace?
我尝试了类似的方法,但无法成功。您是否尝试将这些添加到您的gwt.xml文件中
<set-property name="compiler.stackMode" value="emulated"/>
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true"/>
<set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true"/>
对于SuperDevMode、stacktraces和使用GWT.log
,有一个简单的定义。
在GWT2.8中似乎也有
据我所知,如果您使用普通的
java.util.logging
而不是GWT.log
,您应该在SDM中获得堆栈跟踪。从onModuleLoad调用下面的方法。
请注意,您必须使用java.util.Logging才能工作。对于异常,GWT.log无法正常工作
/**
*设置一个未捕获的异常处理程序,以打开该异常
*(雨伞例外)用于SuperDevMode。
*/
私有void setUncaughtExceptionHandler()
{
setUncaughtExceptionHandler(新的GWT.UncaughtExceptionHandler()
{
@凌驾
未授权例外情况下的公共无效(可丢弃的e)
{
可丢弃展开=展开(e);
BootBox.error(I18NMessages.getMessage(3774)+“\n\n”+展开);
LOGGER.log(Level.EXCEPTION,“onUnAccughtException”+e.getMessage(),未包装);
}
public Throwable unwrap(Throwable e)
{
if (e instanceof UmbrellaException)
{
UmbrellaException ue = (UmbrellaException) e;
if (ue.getCauses().size() == 1)
{
return unwrap(ue.getCauses().iterator().next());
}
}
return e;
}
});
}
public Throwable unwrap(Throwable e)
{
if (e instanceof UmbrellaException)
{
UmbrellaException ue = (UmbrellaException) e;
if (ue.getCauses().size() == 1)
{
return unwrap(ue.getCauses().iterator().next());
}
}
return e;
}
});
记录器是按以下方式创建的
public static final Logger LOGGER = Logger.getLogger("Something");
不,我没有。我只是尝试了一下,但得到了相同的控制台日志。什么是BootBox和i18n消息?BootBox是GWT bootstrap 3中的内容。该行只显示一个带有错误消息的弹出窗口。