Problems compiling internationalisation files with GWT 2.0

350 views
Skip to first unread message

craige

unread,
Dec 10, 2009, 5:15:37 AM12/10/09
to Google Web Toolkit
Hi

I've just tried out GWT 2.0 on a mature GWT project after upgrading
from 1.6 and I'm noticing a compiler error relating to processing of
the internationalisation aspect of the application which I I have
never see before. I was wondering if this is a bug or that I possibly
need to change something in my project.

I'm using properties files for the internationalisation. The
properties files are called :

InternationalizationConstants_en.properties
InternationalizationConstants_es_GTC.properties
InternationalizationConstants_es.properties
InternationalizationConstants.java
InternationalizationConstants.properties

Reading between the lines, there seems to be some conflict between the
processing of the InternationalizationConstants_es_GTC.properties and
the InternationalizationConstants_es.properties files. In the compiler
output (see below) it complains about a compiler generated java file
(see below) which has been created.

If anybody has any ideas they would be most appreciated.

Many thanks

Craige



package com.google.gwt.i18n.client.impl;

import com.google.gwt.i18n.client.LocaleInfo;
import com.google.gwt.i18n.client.constants.NumberConstantsImpl;
import com.google.gwt.i18n.client.constants.DateTimeConstants;
import com.google.gwt.i18n.client.constants.NumberConstants;
import com.google.gwt.i18n.client.constants.DateTimeConstantsImpl;
import com.google.gwt.core.client.GWT;

public class LocaleInfoImpl_es-gtc extends LocaleInfoImpl_shared {
@Override
public String getLocaleName() {
return "es-gtc";
}

@Override
public DateTimeConstants getDateTimeConstants() {
return GWT.create
(com.google.gwt.i18n.client.constants.DateTimeConstantsImpl.class);
}

@Override
public NumberConstants getNumberConstants() {
return GWT.create
(com.google.gwt.i18n.client.constants.NumberConstantsImpl.class);
}
}




The compiler output is as follows :

generate-gwt:

Compiling module GWTApplication.Main
Scanning for additional dependencies: file:/home/cb/localProjects/
FaultDatabase/src/FaultDatabase/FaultDatabase/src/GWTApplication/
client/Main.java
Adding '69' new generated units
Validating newly compiled units
[WARN] Warnings in 'generated://
58FBF6D2AE4B25E89BBA1129719C8225/GWTApplication/client/
FaultService_TypeSerializer.java'
[WARN] Line 205: Referencing deprecated class
'com.google.gwt.user.client.rpc.SerializableException'
See snapshot: /tmp/
FaultService_TypeSerializer21879.java
Scanning for additional dependencies: jar:file:/usr/local/gwt-2.0.0/
gwt-user.jar!/com/google/gwt/i18n/client/LocaleInfo.java
Adding '11' new generated units
Validating newly compiled units
[ERROR] Errors in 'generated://
6156E89F6D1ADDBDACCA415E145F7A5A/com/google/gwt/i18n/client/impl/
LocaleInfoImpl_es-gtc.java'
[ERROR] Line 10: The public type LocaleInfoImpl_es must
be defined in its own file
[ERROR] Line 10: Syntax error on token "-", < expected
[ERROR] Line 10: Syntax error, insert ">" to complete
ReferenceType1
[ERROR] Line 12: The method getLocaleName() of type
LocaleInfoImpl_es must override or implement a supertype method
[ERROR] Line 17: The method getDateTimeConstants() of
type LocaleInfoImpl_es must override or implement a supertype method
[ERROR] Line 22: The method getNumberConstants() of
type LocaleInfoImpl_es must override or implement a supertype method
See snapshot: /tmp/LocaleInfoImpl_es-gtc21890.java
[ERROR] Errors in 'jar:file:/usr/local/gwt-2.0.0/gwt-user.jar!/com/
google/gwt/i18n/client/LocaleInfo.java'
[ERROR] Internal compiler error
java.lang.NullPointerException
at com.google.gwt.dev.javac.CompiledClass.<init>(CompiledClass.java:
81)
at com.google.gwt.dev.javac.JdtCompiler$FindTypesInCud.visit
(JdtCompiler.java:203)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse
(TypeDeclaration.java:1198)
at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse
(CompilationUnitDeclaration.java:687)
at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process
(JdtCompiler.java:157)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:
444)
at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:
466)
at com.google.gwt.dev.javac.CompilationStateBuilder
$CompileMoreLater.compile(CompilationStateBuilder.java:141)
at
com.google.gwt.dev.javac.CompilationStateBuilder.doBuildGeneratedTypes
(CompilationStateBuilder.java:325)
at com.google.gwt.dev.javac.CompilationStateBuilder
$CompileMoreLater.addGeneratedTypes(CompilationStateBuilder.java:126)
at
com.google.gwt.dev.javac.CompilationState.addGeneratedCompilationUnits
(CompilationState.java:86)
at com.google.gwt.dev.javac.StandardGeneratorContext.finish
(StandardGeneratorContext.java:348)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds
(WebModeCompilerFrontEnd.java:129)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.process(AbstractCompiler.java:200)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:
444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.compile(AbstractCompiler.java:123)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.compile(AbstractCompiler.java:234)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access
$200(AbstractCompiler.java:109)
at com.google.gwt.dev.jdt.AbstractCompiler.compile
(AbstractCompiler.java:522)
at
com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations
(BasicWebModeCompiler.java:112)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations
(WebModeCompilerFrontEnd.java:47)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile
(JavaToJavaScriptCompiler.java:421)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile
(JavaScriptCompiler.java:32)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
at com.google.gwt.dev.Compiler.run(Compiler.java:201)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:
87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger
(CompileTaskRunner.java:81)
at com.google.gwt.dev.Compiler.main(Compiler.java:159)

[ERROR] Unexpected
java.lang.NullPointerException
at com.google.gwt.dev.javac.CompiledClass.<init>(CompiledClass.java:
81)
at com.google.gwt.dev.javac.JdtCompiler$FindTypesInCud.visit
(JdtCompiler.java:203)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse
(TypeDeclaration.java:1198)
at
org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse
(CompilationUnitDeclaration.java:687)
at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process
(JdtCompiler.java:157)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:
444)
at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:
466)
at com.google.gwt.dev.javac.CompilationStateBuilder
$CompileMoreLater.compile(CompilationStateBuilder.java:141)
at
com.google.gwt.dev.javac.CompilationStateBuilder.doBuildGeneratedTypes
(CompilationStateBuilder.java:325)
at com.google.gwt.dev.javac.CompilationStateBuilder
$CompileMoreLater.addGeneratedTypes(CompilationStateBuilder.java:126)
at
com.google.gwt.dev.javac.CompilationState.addGeneratedCompilationUnits
(CompilationState.java:86)
at com.google.gwt.dev.javac.StandardGeneratorContext.finish
(StandardGeneratorContext.java:348)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds
(WebModeCompilerFrontEnd.java:129)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.process(AbstractCompiler.java:200)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:
444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.compile(AbstractCompiler.java:123)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox
$CompilerImpl.compile(AbstractCompiler.java:234)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access
$200(AbstractCompiler.java:109)
at com.google.gwt.dev.jdt.AbstractCompiler.compile
(AbstractCompiler.java:522)
at
com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations
(BasicWebModeCompiler.java:112)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations
(WebModeCompilerFrontEnd.java:47)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile
(JavaToJavaScriptCompiler.java:421)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile
(JavaScriptCompiler.java:32)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
at com.google.gwt.dev.Compiler.run(Compiler.java:201)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:
87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger
(CompileTaskRunner.java:81)
at com.google.gwt.dev.Compiler.main(Compiler.java:159)
Java Result: 1

build.war:

BUILD FAILED
/home/cb/localProjects/FaultDatabase/build.xml:149: /home/cb/
localProjects/FaultDatabase/output/www/GWTApplication.Main not found.

Total time: 26 seconds

Compilation exited abnormally with code 1 at Thu Dec 10 09:37:53

grandfatha

unread,
Dec 11, 2009, 4:01:24 AM12/11/09
to Google Web Toolkit
Since upgrading to 2.0, I can no longe compile my i18n files as well.
The compiler complains for a missing key, although the interface/
properties files have not been altered and have worked under 1.5/1.6
and the latest 1.7.1 version. I basically cannot compile my app with
2.0.

Here is the error from the compiler:

Compiling module my.package.gwt.Main
Scanning for additional dependencies: file:/my/path/my/package/util/
Constants.java
Computing all possible rebind results for
'my.package.gwt.i18n.Messages'
Rebinding my.package.gwt.i18n.Messages
Invoking
com.google.gwt.dev.javac.StandardGeneratorContext@3b776b
Processing interface my.package.gwt.i18n.Messages
Generating method body for enterprise()
[ERROR] No resource found for key 'enterprise'
com.google.gwt.i18n.rebind.AbstractResource$MissingResourceException:
No resource found for key 'enterprise'
at com.google.gwt.i18n.rebind.AbstractResource
$ResourceList.getRequiredStringExt(AbstractResource.java:246)
at com.google.gwt.i18n.rebind.SimpleValueMethodCreator.createMethodFor
(SimpleValueMethodCreator.java:95)
at
com.google.gwt.i18n.rebind.AbstractLocalizableImplCreator.delegateToCreator
(AbstractLocalizableImplCreator.java:313)
at com.google.gwt.i18n.rebind.ConstantsImplCreator.emitMethodBody
(ConstantsImplCreator.java:163)
at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.genMethod
(AbstractGeneratorClassCreator.java:265)
at
com.google.gwt.user.rebind.AbstractGeneratorClassCreator.emitMethods
(AbstractGeneratorClassCreator.java:233)
at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.emitClass
(AbstractGeneratorClassCreator.java:116)
at
com.google.gwt.i18n.rebind.AbstractLocalizableImplCreator.generateConstantOrMessageClass
(AbstractLocalizableImplCreator.java:133)
at com.google.gwt.i18n.rebind.LocalizableGenerator.generate
(LocalizableGenerator.java:121)
at com.google.gwt.i18n.rebind.LocalizableGenerator.generate
(LocalizableGenerator.java:98)
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.StandardRebindOracle.rebind
(StandardRebindOracle.java:143)
at com.google.gwt.dev.Precompile
$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers
(Precompile.java:317)
at
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds
(WebModeCompilerFrontEnd.java:95)
[WARN] Searched the following resources:
[WARN] For the following type(s), generated source was never
committed (did you forget to call commit()?)
[WARN] my.package.gwt.i18n.Messages_
[ERROR] Errors in 'file:/my/path/my/package/util/Constants.java'
[ERROR] Line 20: Failed to resolve
'my.package.gwt.i18n.Messages' via deferred binding

grandfatha

unread,
Dec 11, 2009, 6:15:44 AM12/11/09
to Google Web Toolkit
Changing the name of my interface and the properties files resolved at
least my issue. No clue what was wrong with the old one... It simply
disliked it.

sanjay puri

unread,
May 1, 2012, 6:06:33 AM5/1/12
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages