Cuga
Cuga

Reputation: 17904

GWT app using UIBinder won't load properly

My GWT app, using UiBinder, won't load in Internet Explorer. However, it loads just fine in Firefox, Safari, and on the iPhone.

In trying to isolate the problem, I've been stripping out parts trying to find the root cause. I'm down to basically a Label and it still works in FF but not IE.

Here's the EntryPoint:

public class Core implements EntryPoint {

  private static Core instance;
  public static Core instance() {
    return instance;
  }

  @Override
  public void onModuleLoad() {
    instance = this;
    RootPanel container = RootPanel.get("container");
    container.add(new Label("hi"));
  }
}

Here's my index.jsp:

<!doctype html>
<html>
<head>
<script type="text/javascript" src="core/core.nocache.js"></script>
</head>
<body>
    <div id="container"></div>
</body>
</html>

Here's my appengine-web.xml:

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>realAppNameHere</application>
  <version>andrew</version>
  <static-files>
    <include path="**" />
    <!-- The following line requires App Engine 1.3.2 SDK -->
    <include path="**.nocache.*" expiration="0s" />
    <include path="**.cache.*" expiration="365d" />
    <exclude path="**.gwt.rpc" />
  </static-files>
  <!-- Configure java.util.logging -->
  <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
  </system-properties>
</appengine-web-app>

And here's my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

Even with this stripped-down version of everything, it still works in Firefox but not IE. Now there aren't even any bugs thrown, not even in Firebug... it just doesn't show the label in IE, but it will show the label in FF. I have no idea why this isn't running.

Anyone have any idea?

Edit 3:

Forgot the module.gwt.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='core'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.ajaxloader.AjaxLoader'/>
  <inherits name="com.google.gwt.logging.Logging"/>

  <inherits name='com.google.gwt.user.theme.clean.Clean'/>

  <entry-point class='com.company.core.client.Core'/>

  <source path='client'/>
  <source path='shared'/>

  <set-property name="gwt.logging.logLevel" value="SEVERE"/>
  <set-property name="gwt.logging.enabled" value="FALSE"/>
  <set-property name="gwt.logging.consoleHandler" value="ENABLED"/>
  <set-property name="gwt.logging.simpleRemoteHandler" value="DISABLED" />
</module>

Upvotes: 1

Views: 719

Answers (2)

Cuga
Cuga

Reputation: 17904

From testing on an actual copy of IE (not the IE plugin for Firefox) we were able to see an error "console is not defined".

Turns out, this was throwing an exception in IE, preventing the page from loading:

public native static void log(String inString)
/*-{
  console.log(inString);
}-*/;

So to solve this, we'll take out that reference to console and replace with a cross-browser logging library, such as GWT-Log

Upvotes: 1

Abhijith Nagaraja
Abhijith Nagaraja

Reputation: 3380

Some of the things won't come up in IE6 but it will definitely get loaded. The first thing you need to see is whether you have added an User agent for IE6 as

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

in your .gwt.xml file.

Next thing you need to check that whether you added an exception for localhost in your browser security settings.

If all this is done and still not working try to cleanup your project and recompile it.

Upvotes: 1

Related Questions