Debugging a Google Web Toolkit application with a deployment error in Google App Engine

I have a Google Web Toolkit application that I am deploying to the Google App Engine. In a deployed application, I get a JavaScript error Uncaught TypeError: Cannot read property 'f' of null . This is similar to the Java equivalent of a Java NullPointerException exception.

The problem is that the JavaScript GWT is confusing, so it is impossible to debug in the browser, and I cannot reproduce the same problem in the placement mode, where I could use the Java debugger. I think the reason I see an error in the deployed application is because the database that I use on the GAE server runs something other than the test database that I use during testing and development.

So, any ideas on how best to act? I thought about the following things:

  • Deploy an untethered version of my application. Despite the fact that Google Gogling does not work, I can’t figure out how to do this using the automatic deployment script with the Google Eclipse plugin. Somebody knows?
  • Download and copy my GAE data to a local server
  • Somehow specify my development code for using a GAE server for data instead of a local test database. That seems like a better idea ...

Can anyone suggest how to move here?

Finally, is there a way to catch these JavaScript errors on a production server and register them somewhere? Without registration, I will not in any case know if my users have errors that do not occur on the server. The GWT.log () function is automatically removed from the production code ...

+6
debugging google-app-engine gwt google-eclipse-plugin
source share
1 answer

1) If you can localize the required state of your GAE database, run the compiled version of javascript on your local computer. This will almost certainly give the same error, but much cheaper than the full deployment of AppEngine. Do this by compiling the application using the GWT compiler, then run it in normal mode, then point the browser to the specified address without the ?gwt.codesvr=127.0.0.1:9997 .

2) Use -style PRETTY or -style DETAILED with the GWT compiler to get more convenient javascript. If you compile locally with this flag once, deployment to AppEngine (with the Eclipse plugin) will send the same untethered version.

3) A tool of your code ( Window.alert() works fine) to find out exactly where the error occurs. This is especially useful for searching where javascript execution is different from layout mode execution.

4) Speed ​​up the compilation process by saving only one permutation. See how to do it: How to speed up the gwt compiler?

5) Javascript errors that do not appear in the development version or in unit tests (almost always) due to an error in the GWT, after you figure it out a little, go down to the GWT forum or post a tracker see if this is a known error, and is there a workaround.

+3
source share

All Articles