Building for a single locale

623 views
Skip to first unread message

Jim Douglas

unread,
Jan 5, 2011, 2:43:31 PM1/5/11
to Google Web Toolkit

This is driving me around the bend. Our production configuration
builds for all browsers & several languages.

For development / testing purposes, I'm trying to define a restricted
configuration that just hard codes a single locale, like this:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='gwtwebclient'>
<inherits name='com.basis.bbj.web.gwt.GWTWebClient'/>
<extend-property name="locale" values="en_US" />
<set-property name="locale" value="en_US"/>
</module>

That configuration seems to work fine in production mode, setting the
GWT client Locale to "en_US". But this line crashes and burns in
development mode:

m_i18n = GWT.create(I18N.class);

II18n is a bunch of constants:

package com.basis.bbj.web.gwt.client.i18n;

import com.google.gwt.i18n.client.Constants;

public interface I18N extends Constants
{
@DefaultStringValue("Click to reload application")
String clickToReloadApplication();
...
}

FWIW, I've read this several times, hoping to find some clue about
what I'm doing wrong:

http://code.google.com/webtoolkit/doc/latest/DevGuideI18nLocale.html

I can use some suggestions; maybe I'm just missing something really
stupid.

GWT dev mode reports the following less-than-enlightening error
messages:

00:01:14.521 [DEBUG] Rebinding com.basis.bbj.web.gwt.client.i18n.I18N

00:01:14.521 [DEBUG] Invoking
com.google.gwt.dev.javac.StandardGeneratorContext@203317c5

00:01:14.521 [ERROR] Error while executing the JavaScript provider for
property 'locale'
com.google.gwt.core.client.JavaScriptException: (TypeError): u[a] is
not a function fileName: http://localhost:8080/gwtwebclient/gwtwebclient.nocache.js
lineNumber: 7 stack: F("locale")@http://localhost:8080/gwtwebclient/
gwtwebclient.nocache.js:7 ("locale")@http://localhost:8080/
gwtwebclient/gwtwebclient.nocache.js:2 @:0 ([object GWTJavaObject],
147456001,[object XMLHttpRequest])@http://localhost:8080/gwtwebclient/
hosted.html?gwtwebclient:56 ([object Event])@http://localhost:8080:22
((function () {__gwt_makeJavaInvoke(1)(handler, 147456001, _this);}),
[object XMLHttpRequest],[object Object])@http://localhost:8080:34 @:0
(null,27,(function () {__gwt_makeJavaInvoke(1)(handler, 147456001,
_this);}),[object XMLHttpRequest],[object Object])@http://localhost:
8080/gwtwebclient/hosted.html?gwtwebclient:56 ([object Event])@http://
localhost:8080:57
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
195)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
264)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:
189)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getSelectionProperty(ModuleSpacePropertyOracle.java:
127)
at
com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:
91)
at
com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:
418)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
38)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:108)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:54)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
154)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
119)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:
531)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
414)
at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:460)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:1)
at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:
216)
at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:
287)
at com.google.gwt.http.client.RequestBuilder
$1.onReadyStateChange(RequestBuilder.java:393)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:
1713)
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
165)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
264)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:
1668)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
401)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
222)
at java.lang.Thread.run(Thread.java:680)

00:01:14.522 [ERROR] Could not parse specified locale
com.google.gwt.core.ext.BadPropertyValueException: Property 'locale'
cannot be set to unexpected value '<failed to compute>'
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.computePropertyValue(ModuleSpacePropertyOracle.java:
197)
at
com.google.gwt.dev.shell.ModuleSpacePropertyOracle.getSelectionProperty(ModuleSpacePropertyOracle.java:
127)
at
com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:
91)
at
com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:
418)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:
38)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.tryRebind(StandardRebindOracle.java:108)
at com.google.gwt.dev.shell.StandardRebindOracle
$Rebinder.rebind(StandardRebindOracle.java:54)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:
154)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:
119)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:
531)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
414)
at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:460)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:1)
at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:
216)
at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:
287)
at com.google.gwt.http.client.RequestBuilder
$1.onReadyStateChange(RequestBuilder.java:393)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:
1713)
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
165)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
264)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:
1668)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
401)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
222)
at java.lang.Thread.run(Thread.java:680)

00:01:14.523 [ERROR] Deferred binding failed for
'com.basis.bbj.web.gwt.client.i18n.I18N'; expect subsequent failures

00:01:14.523 [ERROR] Uncaught exception escaped
java.lang.RuntimeException: Deferred binding failed for
'com.basis.bbj.web.gwt.client.i18n.I18N' (did you forget to inherit a
required module?)
at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:43)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:460)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:1)
at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:
216)
at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:
287)
at com.google.gwt.http.client.RequestBuilder
$1.onReadyStateChange(RequestBuilder.java:393)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:
1713)
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
165)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
264)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:
1668)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
401)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
222)
at java.lang.Thread.run(Thread.java:680) Caused by:
com.google.gwt.core.ext.UnableToCompleteException: (see previous log
entries)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:
541)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:
414)
at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:460)
at com.basis.bbj.web.gwt.client.GWTWebClient
$InitializeCallback.onSuccess(GWTWebClient.java:1)
at
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:
216)
at
com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:
287)
at com.google.gwt.http.client.RequestBuilder
$1.onReadyStateChange(RequestBuilder.java:393)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:
1713)
at
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:
165)
at
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:
120)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:
507)
at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:
264)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:
91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:
71)
at
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:
157)
at
com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:
1668)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:
401)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:
222)
at java.lang.Thread.run(Thread.java:680)

Jeff Chimene

unread,
Jan 5, 2011, 2:56:55 PM1/5/11
to google-we...@googlegroups.com
Typically, this happens when you don't have a browser-specific module available. Check your server log for 404 errors. Since you've stipulated that you're compiling in a "restricted configuration", I'd start there. Also, clean up your server directory to remove obsolete files and redeploy.

Jim Douglas

unread,
Jan 5, 2011, 3:07:53 PM1/5/11
to Google Web Toolkit
You lost me, Jeff.

The "restriction" involves inheriting the normal .gwt.xml file and
adding these lines to cause it to compile just a single locale (with a
goal of reducing the build time from 15 minutes to a couple of
minutes):

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='gwtwebclient'>
<inherits name='com.basis.bbj.web.gwt.GWTWebClient'/>
<extend-property name="locale" values="en_US" />
<set-property name="locale" value="en_US"/>
</module>

That builds with no problems, and I can run in production mode with
the project compiled this way. When I run the same configuration in
dev mode, it apparently crashes and burns attempting to resolve the
client side locale.

On Jan 5, 11:56 am, Jeff Chimene <jchim...@gmail.com> wrote:

Jim Douglas

unread,
Jan 5, 2011, 3:55:04 PM1/5/11
to Google Web Toolkit
Solved, although I'm not entirely sure I understand this...and the dev
mode error messages are still obscure.

But the problem turns out to have been caused by building the
restricted configuration, but continuing to specify the original
(full) configuration when I started GWT dev mode. Running production
code in that environment continued to work fine, but when I switched
to dev mode, it fell over in a pile.
Reply all
Reply to author
Forward
0 new messages