可能重复:
为什么 Tomcat 无法显示实际的堆栈跟踪?
我正在使用 GWT。我有以下代码来显示客户端异常详细信息。
public void onModuleLoad() {
GWT.setUncaughtExceptionHandler(new
GWT.UncaughtExceptionHandler() {
public void onUncaughtException(Throwable e) {
// my logic which will display error details
}
在托管模式下,每件事都可以正常工作。我在托管模式下获得清晰的异常堆栈跟踪详细信息,如下所示:
Error: java.lang.NullPointerException
com.sample.UserDetailsGrid$1.handleEvent(UserDetailsGrid.java:52)
com.sample.UserDetailsGrid$1.handleEvent(UserDetailsGrid.java:1)
com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:456)
com.extjs.gxt.ui.client.widget.grid.Grid.onClick(Grid.java:813)
com.extjs.gxt.ui.client.widget.grid.Grid.onComponentEvent(Grid.java:496)
com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:884)
com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1264)
sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
但问题是,一旦将 java 文件编译成 javascript 并部署到 tomcat,我会得到与下面相同的异常详细信息,我们无法从堆栈跟踪中理解任何内容。:
Error: (TypeError): null has no properties stack: FLg([object Object],[object Object])@http://localhost:9999/mywebapp/21D01FA6800CA5B30FF5BE80916CCD06.cache.html:
Unknown.FLg(Unknown source:0)
Unknown.ILg(Unknown source:0)
Unknown._Xb(Unknown source:0)
Unknown.Rkc(Unknown source:0)
Unknown.bqd(Unknown source:0)
Unknown.wqd(Unknown source:0)
Unknown.ilc(Unknown source:0)
Unknown.tmc(Unknown source:0)
Unknown.I5f(Unknown source:0)
Unknown.anonymous(Unknown source:0)
Unknown.VNd(Unknown source:0)
你能解释一下这种行为的原因吗?
谢谢!