我正在使用GWT展示:
http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwRichText
和google-web-toolkit:
创建一个要输入和显示的富文本区域。我遇到的问题是,当我编译时,我得到错误:
[ERROR] Errors in 'org/AwardTracker/client/RichTextToolbar.java'
[ERROR] Line 265: Failed to resolve 'org.AwardTracker.client.RichTextToolbar.Strings' via deferred binding
第265行是:
private Strings strings = (Strings) GWT.create(Strings.class);
我将其包含在一个有效的项目中,并在其他类中使用String。如:
String imagePath = new String();
我只对GWT和java有基本的了解,所以任何帮助都会非常感激。
此致
格林
添加RichTextToolbar_Strings.properties
后我收到以下编译错误:
Compiling module org.AwardTracker.AwardTracker
Validating units:
Ignored 2 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Computing all possible rebind results for 'org.AwardTracker.client.RichTextToolbar.Strings'
Rebinding org.AwardTracker.client.RichTextToolbar.Strings
Invoking generator com.google.gwt.i18n.rebind.LocalizableGenerator
Processing interface org.AwardTracker.client.RichTextToolbar.Strings
Generating method body for black()
[ERROR] No resource found for key 'black'
com.google.gwt.i18n.rebind.AbstractResource$MissingResourceException: No resource found for key 'black'
at com.google.gwt.i18n.rebind.AbstractResource$ResourceList.getRequiredStringExt(AbstractResource.java:290)
at com.google.gwt.i18n.rebind.SimpleValueMethodCreator.createMethodFor(SimpleValueMethodCreator.java:95)
at com.google.gwt.i18n.rebind.AbstractLocalizableImplCreator.delegateToCreator(AbstractLocalizableImplCreator.java:501)
at com.google.gwt.i18n.rebind.ConstantsImplCreator.emitMethodBody(ConstantsImplCreator.java:163)
at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.genMethod(AbstractGeneratorClassCreator.java:277)
at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.emitMethods(AbstractGeneratorClassCreator.java:239)
at com.google.gwt.user.rebind.AbstractGeneratorClassCreator.emitClass(AbstractGeneratorClassCreator.java:118)
at com.google.gwt.i18n.rebind.AbstractLocalizableImplCreator.generateConstantOrMessageClass(AbstractLocalizableImplCreator.java:221)
at com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:151)
at com.google.gwt.i18n.rebind.LocalizableGenerator.generate(LocalizableGenerator.java:124)
at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:676)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleGwtCreate(UnifyAst.java:387)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:465)
at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:255)
at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:244)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:117)
at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:65)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:117)
at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:65)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:117)
at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:48)
at com.google.gwt.dev.jjs.ast.JModVisitor$ListContextImmutable.traverse(JModVisitor.java:170)
at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemoveImmutable(JModVisitor.java:336)
at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:138)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:134)
at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:82)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:449)
at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:418)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:940)
at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:665)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:672)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:34)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:271)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:223)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:139)
at com.google.gwt.dev.Compiler.run(Compiler.java:167)
at com.google.gwt.dev.Compiler.run(Compiler.java:132)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:99)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:106)
[WARN] Searched the following resources:
[WARN] org/AwardTracker/client/RichTextToolbar_Strings.properties
List of keys found
</style>
white-space
<span
<!--[if
.cursor,
tr.inline_comment
{"loggedInUserEmail"
background-color
</span>
genState.table_base_id
changed_paths.push('/tags/2.4.0');
<style
<img
height
</td>
element
kibbles.skipper.addStopListener(
margin
<table><tr><td>Go
<dt>svn
onclick
numRow
</tr></table>
<br>
.nocursor,
CR_BrowseIntegrationFactory);
srcGenState.chunk_id
>
alignerRunning
genState.row_num
row.className
google-web-toolkit
</tr>
itemscope
srcGenState.row_num
<pre>Tag
by
.menuIcon.on
#review_nav
<![endif]-->
setTimeout(continueToSetLineNumberHeights,
element.className
35
window.location
div.draft
<option
return;
setTimeout(setLineNumberHeights,
reloadCursors();
Your
</html>
})();
|
}
<form
#file_flipper
border-top
RichTextToolBar_Strings.properties
'u',
><tr>
codereviews.registerActivityListener(CR_ActivityType.REVEAL_DRAFT_PLATE,
</body>
.menuIcon.down
<!DOCTYPE
...</pre>
numsGenState.chunk_id
><tr
<body
#file_flipper.hidden
</a>
changed_urls.push('/p/google-web-toolkit/source/browse/tags/2.4.0?rx3d10590x26specx3dsvn11688');
contributes
kibbles.skipper.addRevKey("p");
><u>Sign
><td
continueToSetLineNumberHeights();
kibbles.skipper.setCurrentStop(lastStop);
codereviews.registerActivityListener(CR_ActivityType.DISCARD_DRAFT_COMMENT,
lastStop
page
genState.row_num++;
><u><b>glyndwr.bartlett@gmail.com</b></u>
rowsInThisPass++;
prev.element.className
</pre>
for
<div
<pre><table
title
margin-left
kibbles.keys.addKeyPressListener(
['siteTracker._setAccount',
</head>
></table></pre>
font-family
class
['siteTracker._trackPageview']);
s.parentNode.insertBefore(po,
</title>
.undermouse
<dd>native</dd>
<dl>
vertical-align
</div>
border-bottom
<div>Size
max-width
{var
<pre
avoid
(function()
kibbles.skipper.append(element);
numsGenState.table
</dl>
window.___gcfg
codereviews.registerActivityListener(CR_ActivityType.REVEAL_PUB_PLATE,
kibbles.skipper.LISTENER_TYPE.PRE,
<strong
window.onload
>/tags/2.4.0</option>
href
id
if
var
srcGenState.table
po.type
.menuIcon.off
kibbles.skipper.reset();
</script>
<p>File
div.published
kibbles.keys.addKeyPressListener('j',
'r',
kibbles.keys.addKeyPressListener('k',
startOver
genState.table
genState.chunk_id++;
<input
</ul>
oldTR.className
(document.getElementsByTagName('head')
</td></tr></table>
cellpadding
gutterOut();
<title>RichTextToolbar_Strings.properties
word-wrap
_gaq.push(
<html>
GWT
display
lineNumUnderMouse
<div>
.list
width
margin-bottom
return
newTR.className
'gr_svn11688_'
while
numsGenState.row_num
updateCursorForCell(data.cellId,
<li><a
window.onresize
RichTextToolbar$Strings.properties
next.element.className
<span>
numRow.firstChild.style.height
><u>Profile</u></a>
function
background-image
</form>
border
<a
</select>
alt
div.draft,
initLineNumberHeights();
<td
CR_toggleCommentDisplay();
kibbles.skipper.setOption('padding_bottom',
<link
background
<tr
kibbles.skipper.setOption('padding_top',
<meta
font-size
<select
<p>Change
<ul
<tr>
margin-top
<script
on
ga.src
//
padding
<table
</table>
padding-top
><u>My
srcRow
codereviews
<head>
<dd>text/plain;
<p>Older
kibbles.skipper.addFwdKey("n");
<div><a
loadCursors();
[ERROR] Errors in 'org/AwardTracker/client/RichTextToolbar.java'
[ERROR] Line 265: Failed to resolve 'org.AwardTracker.client.RichTextToolbar.Strings' via deferred binding
[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
[WARN] org.AwardTracker.client.RichTextToolbar_Strings_
答案 0 :(得分:1)
Strings
!= String
。您的示例new String()
是新String值的创建。 Strings
是不同的。简而言之,它会将属性文件中的文本与Strings
接口绑定,因为它扩展了Constants
。有关其工作原理的详细信息,请参阅GWT文档以获得更详细的解释。 http://www.gwtproject.org/doc/latest/DevGuideI18nConstants.html
在这种情况下,您还应该将演示文件中的文件RichTextToolbar_Strings.properties
放在与RichTextToolbar.java
文件相同的文件夹中。我认为问题是由这个丢失的文件引起的。你有吗?