Simple GWT sample code from Eclipse does NOT run in Chrome!

258 views
Skip to first unread message

Danux

unread,
Oct 3, 2011, 1:34:34 AM10/3/11
to Google Web Toolkit
After wondering why my little app wouldn't display properly in my
Chrome browser once compiled, but work fine in Firefox, I decided to
create an empty new Web Application Project in Eclipse and let it ONLY
generate the initial sample code, nothing else. After compiling that
unaltered code (obfuscated or pretty), it WILL run properly in Firefox
7.0 and IE 6.0, but NOT in Google Chrome (14.0.835.186). Is this some
kind of joke? Please someone help me here.

System: Linux Ubuntu 10.10 32-bit, Google Chrome 14, Firefox 7.0, IE
6.0 (in Win XP), Java 1.7.0, GWT 2.4.0, Eclipse Indigo Service Rel. 1,
GWT plugin installed for Eclipse and developer plugin for Chrome.

Isaac Truett

unread,
Oct 3, 2011, 1:17:02 PM10/3/11
to google-we...@googlegroups.com
GWT apps work fine in Chrome for me. You'll have elaborate on the problem you're seeing. Just saying it doesn't display properly doesn't help diagnose your problem. Does the JS console show anything? How about the Developer Tools' Network tab? Any resources failing to load? Or is this just an aesthetic problem - alignment or font size or something like that?



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


Danux

unread,
Oct 3, 2011, 4:45:07 PM10/3/11
to Google Web Toolkit
I wanted to spare people go through my own code, so I simply create a
new web application project in Eclipse Indigo and compile the starter
code right away. When I click on the html page, I should see "Web
Application Starter Project" in large font, then "Please enter your
name:" with a text field and a send button. This works as it should in
Firefox, even in IE. In Chrome, all it shows is the two lines of text,
no text field and no send button either. I tried the same compiled
files on various Linux PCs with both Chrome and Firefox (with and
without dev plugins installed), as well as Windows XP with IE, Firefox
and Chrome again. On both platforms the web application starter code
works fine in Firefox (and IE), but not in Chrome. I don't think
resources fail to load, if Firefox sees everything, right? No, not
just an aesthetics problem, but widgets are missing. Should I maybe
revert back to JDK 1.6? An older GWT perhaps?

David Given

unread,
Oct 3, 2011, 6:34:08 PM10/3/11
to google-we...@googlegroups.com
On 03/10/11 21:45, Danux wrote:
> I wanted to spare people go through my own code, so I simply create a
> new web application project in Eclipse Indigo and compile the starter
> code right away. When I click on the html page...

Are you doing this from a file manager? That loads the HTML page into
the web browser via a file:// URL. Chrome doesn't support web apps via
the file scheme. Instead you'll need to serve up the web app via a
proper web server so that you can access it via a http:// URL.

--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────

│ "Under communism, man exploits man. Under capitalism, it's just the
│ opposite." --- John Kenneth Galbrith

signature.asc

Danux

unread,
Oct 3, 2011, 7:42:26 PM10/3/11
to Google Web Toolkit
Yes! Thanks, mystery solved! Uploaded to my server and now it works.
It didn't even occur to me that Chrome wouldn't support web apps via
file:// URL. Anyway, thanks a bunch guys. Greatly appreciated.
>  signature.asc
> < 1KViewDownload

Thomas Broyer

unread,
Oct 3, 2011, 7:45:54 PM10/3/11
to google-we...@googlegroups.com
If you're opening the file off the filesystem (rather than served by an HTTP server)n then that's the expected behavior (and expect other browsers to follow Chrome in the future). This is because each file:// URL should have its own origin; loading a *.cache.html in an iframe and trying to make it access its parent (as GWT does by default) thus violates the Same-Origin Policy.

Danux

unread,
Oct 3, 2011, 11:58:25 PM10/3/11
to Google Web Toolkit
Yeah, I just wasn't thinking in that direction - at all. When two
browsers have no difficulty loading my local files and then Chrome
shows some stuff but not the widgets, then I suspected a bug in the
latest GWT or browser version maybe. Now that I know, I'll just upload
to the server, no biggie.
Reply all
Reply to author
Forward
0 new messages