0

I am starting my GWT application from eclipse in development mode.
It starts up fine in Chrome but in Firefox I get an empty window.
I have no errors in the console or the development console.
And when I start Firebug I can see all the elements (html/css etc) of my login screen.

I also tried to set the user agent in gwt.xml to:

<set-property name="user.agent" value="gecko1_8"/>

but that did not help.

Why does this happens? and how can I fix it?

kroiz
  • 1,722
  • 1
  • 27
  • 43

1 Answers1

2

Often it is caused by corrupt cache. Stop the application server and delete the GWT compiled output from your war directory. With any luck, your recompiled Web App will now run as expected. You will soon become acquainted with the process as it is a annoying characteristic of the Eclipse GWT plugin. It's worth mentioning the IntelliJ IDE here because it is a superior compiler and does not suffer these puzzling quirks, however GWT support requires the Ultimate Edition ($).

A typical war directory has the following structure:

  • mywebapp/
  • WEB-INF/
  • index.html

The directory to delete is mywebapp. This is be a fully qualified path of your WebApps GWT module (.gwt.xml) or more commonly, it is renamed to the rename attribute defined in the same module. For example, MyWebApp.gwt.xml may look like this:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="mywebapp">
    <entry-point class="com.mywebsite.client.MyWebAppEntry"/>
    <source path="client"/>
</module>

If the rename-to attribute wasn't defined, the GWT compiler would place a directory in your WAR directory called com.mywebsite.MyWebApp. But because we defined the rename attribute, the GWT compiler simplifies the output by taking the shortened name from the module xml.

Don't forget to refresh the project if Eclipse complains the directory structure is out of sync with the project.

LoneWolf
  • 176
  • 1
  • 9
  • What should I delete from there? – kroiz May 27 '12 at 02:02
  • 1
    I have edited the answer to provide you further clarification. I hope it helps – LoneWolf May 27 '12 at 02:51
  • Thanks, That is good to know, however, that did not made any difference. the application is still invisible in Firefox. – kroiz May 27 '12 at 08:00
  • 1
    I'm surprised to hear that. It is a common problem my co-worker and myself experience frequently. Try clearing your browser cache too and continue to manually purge the GWT compiler output. Deploy the app to app-spot.com if you require a sanity check because there is probably nothing wrong with your code if you are using ordinary GWT API. – LoneWolf May 27 '12 at 08:11
  • Thanks LoneWolf, however, that did not do it either... Other members of my team have the same problem and the same thing happens on the deployed tomcat server. – kroiz May 27 '12 at 19:06
  • 1
    Damn. The next place I would look are any third party GWT modules you are using and native JSNI methods if you have written any. If you are calling Java methods from JSNI, wrap them in [$entry](http://stackoverflow.com/questions/5449067/gwt-2-x-entry-function). If possible, temporarily strip third party modules from your project one at a time just to see if you can get your application to respond. – LoneWolf May 28 '12 at 01:40