Win XP Firefox HostedMode problem with non-english server locale

15 views
Skip to first unread message

Johal

unread,
May 20, 2006, 4:21:07 AM5/20/06
to Google Web Toolkit
When using Firefox against the hosted mode servlet I get the following
exception:

java.lang.IllegalArgumentException
java.util.Date.parse(Date.java:582)
com.google.gwt.dev.shell.GWTShellServlet.isNotModified(GWTShellServlet.java:456)
com.google.gwt.dev.shell.GWTShellServlet.doGetPublicFile(GWTShellServlet.java:363)
com.google.gwt.dev.shell.GWTShellServlet.processFileRequest(GWTShellServlet.java:221)
com.google.gwt.dev.shell.GWTShellServlet.doGet(GWTShellServlet.java:238)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:67)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


the GWTShellServlet seems to encode date response headers using the
JVM's default locale.

Example response headers starting the shell when windows input locale
is danish

HTTP/1.1 200 OK
Date:lø, 20 maj 2006 07:41:24 GMT
Last-Modified:ma, 15 maj 2006 23:44:10 GMT
Expires:on, 2 jan 1980 04:00:00 GMT
Content-Type:text/html
Content-Length:377
Server:Apache-Coyote/1.1

The exception happens when I refresh a page,
Firefox sets the request header:
If-Modified-Since : ma, 15 maj 2006 23:44:10 GMT

and java.util.Date.parse() doesn't handle that date format

IE seems to discard the faulty headers (I'm pretty sure that the HTTP
date header format has to be in english), so with IE it's not a problem
although nothing generated will be cached in the browser (didn't
actually check )

A temporary fix (before the google developers fix this - hint hint), is
to force the JVM to run with en_US locale:
add the following system properties to the java command that launches
the GWTShell

-Duser.language=en -Duser.region=US

i.e. in Mail-shell.cmd
@java -Duser.language=en -Duser.region=US -cp "%~dp0\src ......

/Johannes

P.s. java.util.Date.parse(String s) has been deprecated since JDK 1.1
(so that's 9 or so years ago) how embarasing ;-)

benwit

unread,
May 29, 2006, 5:55:51 AM5/29/06
to Google Web Toolkit
I have a similar problem but just with Firefox and not all the time.
The solution for me is only to modify the default language in Firefox.
Thanks to fix this bug in next release.


[Pour les lecteurs français]
J'ai un problème similaire mais juste avec Firefox et pas tout le
temps (ça a eu marché sans rien faire et là, ça ne marche plus).
Grace au message de Johal, la solution que j'ai trouvé à consister à
modifier la langue par défaut de firefox (J'ai choisi en-us).
Merci de corriger ce problème dans la prochaine version.

benwit

unread,
May 29, 2006, 6:05:00 AM5/29/06
to Google Web Toolkit
Precision : I have this error with the sample "Mail"
(http://localhost:8888/com.google.gwt.sample.mail.Mail/Mail.html) and
GWT 1.0.21 BETA

benwit

unread,
May 29, 2006, 6:33:39 AM5/29/06
to Google Web Toolkit
I don't understand.
This framework is not stable.
I have write a test :

public void onModuleLoad()
{
HorizontalPanel header = new HorizontalPanel();
header.add(new Label("Date"));
header.add(new Label("Logo"));
header.add(new Label("Languages"));

HorizontalPanel body = new HorizontalPanel();
body.add(new Label("Body"));

DockPanel window = new DockPanel();
window.add(header, DockPanel.NORTH);
window.add(body, DockPanel.CENTER);
window.setWidth("100%");

RootPanel.get().add(window);
}


In Hosted Mode, OK.

In Firefox 1.5.0.3 :

1/ Fist time ==> Error 500 :


java.lang.IllegalArgumentException
java.util.Date.parse(Date.java:582)
com.google.gwt.dev.shell.GWTShellServlet.isNotModified(GWTShellServlet.java:456)
com.google.gwt.dev.shell.GWTShellServlet.doGetPublicFile(GWTShellServlet.java:363)
com.google.gwt.dev.shell.GWTShellServlet.processFileRequest(GWTShellServlet.java:221)
com.google.gwt.dev.shell.GWTShellServlet.doGet(GWTShellServlet.java:238)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:67)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

(Language in firefox : en-us)

2/ After refresh (F5) ==> White page !

3/ After refresh (F5) ==> Error 500 (same error)

4/ After refresh (F5) ==> Error 500 (same error)

5/ After refresh (F5) ==> Page is display ! (OK)

6/ After refresh (F5) ==> Error 500 (same error)

7/ After refresh (F5) ==> White page !

...

I do not like the random behavior !!!
How explain this?

Johal

unread,
May 31, 2006, 2:23:24 PM5/31/06
to Google Web Toolkit
But why don't you just do as I wrote in my first entry, and all your
problems will go away...;-)

benwit

unread,
Jun 1, 2006, 3:40:18 AM6/1/06
to Google Web Toolkit

Johal

unread,
Jun 1, 2006, 5:01:17 AM6/1/06
to Google Web Toolkit
Try to flush your browser cache

Reply all
Reply to author
Forward
0 new messages