Search code examples
javascriptgwtgwt-rpc

GWT : null stack


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?


Solution

  • First, the message should be read as "X is null" and "stack: ...", not "null stack".

    You can "deobfuscate" what TBe means by looking at the symbolMap generated by GWT (by default in WEB-INF/deploy): find the symbolMap file corresponding to the permutation your browser is loading (the symbolMap file name is the same as the cache.html file loaded by your browser) and then search for TBe 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.