PDA

View Full Version : gxt and i18n translation



emcell
14 Mar 2011, 3:41 AM
Hello,

at first sorry for my bad english. i hope you understand my question.

i have a problem with translation and gxt. I followed the instructions at the "Developer's Guide - Internationalization" on the google page.

I'm getting a strange error:


Exception while loading module digitronic.ems.client.EnergyManagementServer. See Development Mode for details.
java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:183) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:510) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ExceptionInInitializerError at com.extjs.gxt.ui.client.widget.Component.(Component.java:202) at digitronic.ems.client.EnergyManagementServer.onModuleLoad(EnergyManagementServer.java:12) ... 9 more Caused by: java.lang.RuntimeException: Deferred binding failed for 'com.extjs.gxt.ui.client.messages.XMessages' (did you forget to inherit a required module?) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:53) at com.google.gwt.core.client.GWT.create(GWT.java:97) at com.extjs.gxt.ui.client.GXT.(GXT.java:43) ... 11 more Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:595) at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455) at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) ... 13 more


gwt.xml:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='energymanagementserver'>
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.google.gwt.i18n.I18N"/>

<inherits name='com.google.gwt.user.theme.standard.Standard'/>
<inherits name='com.extjs.gxt.ui.GXT'/>
<inherits name='com.google.gwt.maps.GoogleMaps' />

<extend-property name="locale" values="de"/>

<!-- Specify the app entry point class. -->
<entry-point class='digitronic.ems.client.EnergyManagementServer'/>

<!-- Specify the paths for translatable code -->
<source path='client'/>
<source path='shared'/>
<inherits name="net.sf.gilead.Gilead4Gwt"/>
<inherits name="com.extjs.gxt.charts.Chart"/>
<inherits name="digitronic.ems.EnergyManagementServer"/>



</module>


EntryPoint html:

<!doctype html>
<!-- The DOCTYPE declaration above will set the -->
<!-- browser's rendering engine into -->
<!-- "Standards Mode". Replacing this declaration -->
<!-- with a "Quirks Mode" doctype may lead to some -->
<!-- differences in layout. -->

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="EnergyManagementServer.css">
<link rel="stylesheet" type="text/css" href="resources/css/gxt-all.css" /> <script language='javascript' src='resources/flash/swfobject.js'></script>
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>EnergyManagementServer</title>

<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript" src="energymanagementserver/energymanagementserver.nocache.js"></script>
</head>

<!-- -->
<!-- The body can have arbitrary html, or -->
<!-- you can leave the body empty if you want -->
<!-- to create a completely dynamic UI. -->
<!-- -->
<body>

<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>

<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>

</body>
</html>








EntryPoint Class:

ackage digitronic.ems.client;


import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;

import com.google.gwt.core.client.EntryPoint;

public class EnergyManagementServer implements EntryPoint {

public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new BorderLayout());
}


}


The Error comes up when i append this line to the gwt.xml

<extend-property name="locale" values="de"/>

If I leave out this line, everything works fine.

what am I doing wrong?

Best Regards
Marcel Springer

edit:

Please move it to: ext gwt 2.x help

emcell
14 Mar 2011, 10:30 PM
after the restart of my computer in the morning everything works fine! very strange!