Why does GWT sometimes successfully compile and other times just stall?

373 views Asked by At

I am working on a demo for a client of what's possible with GWT-Ext for GWT. After browsing for the simplest way to get up and running, I decided on installing the Google Plugin for Eclipse and using the New Web Application Wizard.

First time around, I followed these steps for create the default application:

  • Selected File > New > Web Application Project from the Eclipse menu.
  • In the New Web Application Project wizard, entered a name for the project (ExtDemo) and a java package name, com.extdemo.
  • Unchecked the "Use Google App Engine" check box.
  • Clicked Finish.
  • Right clicked it in package explorer and selected Run As > Run Configurations
  • Put a check in the Automatically Select Unused Port checkbox.
  • Clicked Run to see the default GWT 1.7 application

This worked fine... it launched GWT's hosted browser and the app worked as supposed to.

(I then continued to import GWT-Ext and add all sorts of widgets building up a nice little demo app)

However at some point when relaunching the app in hosted mode, the hosted browser displays an empty iframe. I even reverted the code to a point where everything was working as supposed to and... same thing, an empty iframe with the surrounding static content.

Now what is really strange is when I go through the process of creating the default application again by following the steps above, the hosted browser launches with an empty iframe again.

However when I click on Compile/Browse, this sometimes allows the app to launch in Firefox.

Anyone have this happen to them?

3

There are 3 answers

0
Thimmayya On BEST ANSWER

I have seen some odd behaviors occasionally. Here are some basic suggestions (some are dumb and you might have tried them already):

  1. Use a new workspace
  2. I do not know if GWT plugin somehow caches stuff in the embedded Jetty. If you are re-creating the default app/project, try and use a different name for the project.
  3. Try and re-use a fixed port so that there is no possibility of having multiple servers running.

    Update: Found a new "classic" solution: Delete the cache in IE and possibly Firefox too. Apparently the 'script' tag content tends to be cached by IE. If this works, we can all try tearing our hair out!

Found the updated answer at this link:

0
Daniel Vaughan On

I have had the same problem in the past and found it is much more likely to happen if limited CPU is available. For example if my older laptop was running on battery and had stepped down the CPU speed to save power it frequently happened. When running on mains in max performance mode it only happened occasionally. Now I have a much newer and more powerful laptop and the problem has gone away.

Another cause I found was too many breakpoints set up in eclipse and removing breakpoints would often clear the problem.

0
Iker Jimenez On

I've had issues with the browser caching. Try clearing your browser cache, refresh a few times after a failed load, etc.

You can also try using a different port so the URL is different.

It takes some time to download and run the GWT app, particularly if you are using extra libraries, so wait for a few seconds to see if the app finally loaded.

What makes the app loading to fail randomly is something I don't know yet, but I suspect, as stated by Daniel Vaughan, that is related with a lack of computer resources, CPU, memory, etc.