GWT:空堆栈
每当我想做一些操作时,我都会遇到这个异常。
(TypeError): b.k.g.E is null stack: TBe([object Object]) ....
我怎样才能纠正它?
I get this exception every time when I want do some operation.
(TypeError): b.k.g.E is null stack: TBe([object Object]) ....
How can I correct it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,消息应读作“X is null”和“stack: ...”,而不是“null stack”。
您可以通过查看 GWT 生成的
symbolMap
(默认在WEB-INF/deploy
中)来“反混淆”TBe
的含义:找到与浏览器正在加载的排列相对应的symbolMap
文件(symbolMap
文件名与浏览器加载的cache.html
文件相同)然后搜索其中包含TBe
(区分大小写!),它将为您提供 Java 代码中相应的方法。这可能会提示您哪些内容可能为空。另外,如果您使用 Chrome,您可以在开发工具中漂亮打印 JS 代码,这样您就可以轻松调试代码:在
TBe
函数中设置断点以及调试、分步、检查变量等。就像您在 Eclipse(或任何 IDE)中使用 Java 所做的那样。请注意,GWT 2.5 将生成
SourceMaps
,它允许您在浏览器中查看并“调试”您的 Java 代码!屏幕截图此处和设计文档那里。First, the message should be read as "X is null" and "stack: ...", not "null stack".
You can "deobfuscate" what
TBe
means by looking at thesymbolMap
generated by GWT (by default inWEB-INF/deploy
): find thesymbolMap
file corresponding to the permutation your browser is loading (thesymbolMap
file name is the same as thecache.html
file loaded by your browser) and then search forTBe
within it (case sensitive!), and it'll give you the corresponding method in your Java code. That might give you a hint as to what could be null.Also, if you use Chrome, you can pretty-print the JS code in the Dev Tools, which allows you to easily debug the code: set a breakpoint in the
TBe
function and debug, step-by-step, inspecting variables, etc. Just as you do in Java within Eclipse (or whichever your IDE).Note that GWT 2.5 will generate
SourceMaps
which will allow you to see and "debug" your Java code from within your browser! Screenshot here, and design doc there.