GWT 2.0 - Problem with Eclipse plugin and UiBinder "Field xxx has no corresponding field in template file yyy.ui.xml"

1,241 views
Skip to first unread message

hoxbro

unread,
Dec 10, 2009, 2:56:24 PM12/10/09
to Google Web Toolkit
Whenever I try to explore to possibilities with the new UiBinder,
Eclipse tells me that e.g.:
"Field button has no corresponding field in template file
Mail.ui.xml".

Even when I use the Eclipse Wizard "New UiBinder" the web app wont
build or run in dev-mode.

I have tried to import the Mail sample into Eclipse - no problem. But
when I try to add a new UiField, I get the error again.

It's probably a very fundamental error - and I apologize for any
inconvenience this post may cause - but I give it a try anyway.

Here's the wizard generated file Pjat

public class Pjat extends Composite {
private static PjatUiBinder uiBinder = GWT.create
(PjatUiBinder.class);
interface PjatUiBinder extends UiBinder<Widget, Pjat> {}
@UiField Button button; // <-- This line gets a red underline
public Pjat(String firstName) {
initWidget(uiBinder.createAndBindUi(this));
button.setText(firstName);
}
@UiHandler("button") // <-- This line gets a red underline
void onClick(ClickEvent e) {
Window.alert("Hello!");
}
}

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style>
.important {font-weight: bold;}
</ui:style>
<g:HTMLPanel>
Hello,
<g:Button styleName="{style.important}" ui:field="button" />
</g:HTMLPanel>
</ui:UiBinder>

Jason Parekh

unread,
Dec 11, 2009, 10:39:48 AM12/11/09
to google-we...@googlegroups.com
Hey,

Thanks for reporting this, definitely seems like a bug in the plugin.

First, could you try forcing a clean build of your project? (Project
> Clean) This will force a re-indexing of the UiBinder indices.

Also, could you check your Eclipse log for any errors? The log file
lives at your workspace/.metadata/.log .

A few more questions:
- Which package does your Pjat class live in?
- What version of Eclipse are you using?
- What operating system are you running?

Thanks!
jason
> --
>
> You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
> To post to this group, send email to google-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
>
>
>

hoxbro

unread,
Dec 14, 2009, 3:47:23 AM12/14/09
to Google Web Toolkit
Hi,

Thanks for feedback and sorry for my late reply.

> First, could you try forcing a clean build of your project? (Project
> Clean) This will force a re-indexing of the UiBinder indices.

A clean build removes Eclipse warnings.
Stopping/Starting Development Mode does the same.

> Also, could you check your Eclipse log for any errors? The log file
> lives at your workspace/.metadata/.log .

Using the Wizard to add a new UiBinder generates no entries in the log
file......

> - Which package does your Pjat class live in?
com.hoxbro

> - What version of Eclipse are you using?

java.version=1.6.0_12
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=da_DK
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product
org.eclipse.epp.package.jee.product
Eclipse Build: 20090621-0832
Eclipse distro: Galileo JEE (win32)
GWT and GWT Eclipse Plugin installed from Eclipse (following the
instructions http://code.google.com/intl/da/webtoolkit/usingeclipse.html)

> - What operating system are you running?
Win XP (SP3)

Thanks,
/Søren

Julien Ortega

unread,
Dec 14, 2009, 5:46:53 AM12/14/09
to Google Web Toolkit
Hi,
I had the same problem and it was only a matter of buildpath.
Your source folder in your buildpath can not have an "Included : **/
*.java" but "Included : (All)" because of the ui.xml files.
Maybe you have the same problem ?

On Dec 14, 9:47 am, hoxbro <shox...@gmail.com> wrote:
> Hi,
>
> Thanks for feedback and sorry for my late reply.
>
> > First, could you try forcing a clean build of your project?  (Project
> > Clean)  This will force a re-indexing of the UiBinder indices.
>
> A clean build removes Eclipse warnings.
> Stopping/Starting Development Mode does the same.
>
> > Also, could you check your Eclipse log for any errors?  The log file
> > lives at your workspace/.metadata/.log .
>
> Using the Wizard to add a new UiBinder generates no entries in the log
> file......
>
> > - Which package does your Pjat class live in?
>
> com.hoxbro
>
> > - What version of Eclipse are you using?
>
> java.version=1.6.0_12
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=da_DK
> Framework arguments:  -product org.eclipse.epp.package.jee.product
> Command-line arguments:  -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.jee.product
> Eclipse Build: 20090621-0832
> Eclipse distro: Galileo JEE (win32)
> GWT and GWT Eclipse Plugin installed from Eclipse (following the
> instructionshttp://code.google.com/intl/da/webtoolkit/usingeclipse.html)

Jason Parekh

unread,
Dec 14, 2009, 10:14:44 AM12/14/09
to google-we...@googlegroups.com
Hi Julien,

Thanks for pointing this scenario out, I've opened
http://code.google.com/p/google-web-toolkit/issues/detail?id=4353 to
present a better error message for this.

Hoxbro, as Julien mentioned, could you please let us know if the issue
you're seeing is caused by this?

Thanks,
jason

Peter

unread,
Dec 21, 2009, 10:21:56 AM12/21/09
to Google Web Toolkit
Jason,
I can see the same problem. Made sure I have in source buildpath
Include All and Exclude None. However, issue still persists.

Regards
Peter

On Dec 14, 4:14 pm, Jason Parekh <jasonpar...@gmail.com> wrote:
> Hi Julien,
>
> Thanks for pointing this scenario out, I've openedhttp://code.google.com/p/google-web-toolkit/issues/detail?id=4353to
> present a better error message for this.
>
> Hoxbro, as Julien mentioned, could you please let us know if the issue
> you're seeing is caused by this?
>
> Thanks,
> jason
>

> On Mon, Dec 14, 2009 at 5:46 AM, Julien Ortega <dun7...@gmail.com> wrote:
> > Hi,
> > I had the same problem and it was only a matter of buildpath.
> > Your source folder in your buildpath can not have an "Included : **/
> > *.java" but "Included : (All)" because of the ui.xml files.
> > Maybe you have the same problem ?
>
> > On Dec 14, 9:47 am, hoxbro <shox...@gmail.com> wrote:
> >> Hi,
>
> >> Thanks for feedback and sorry for my late reply.
>
> >> > First, could you try forcing a clean build of your project?  (Project
> >> > Clean)  This will force a re-indexing of the UiBinder indices.
>
> >> A clean build removes Eclipse warnings.
> >> Stopping/Starting Development Mode does the same.
>
> >> > Also, could you check your Eclipse log for any errors?  The logfile
> >> > lives at your workspace/.metadata/.log .
>

> >> Using the Wizard to add a new UiBinder generatesnoentries in the log

Peter

unread,
Dec 21, 2009, 10:58:18 AM12/21/09
to Google Web Toolkit
Here is what I can see in .metadata/.log:

!ENTRY com.google.gwt.eclipse.core 4 0 2009-12-21 16:54:45.328
!MESSAGE Unexpected Exception
!STACK 0
java.lang.ClassNotFoundException: com.google.gwt.dev.About
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.google.gwt.eclipse.core.runtime.GWTRuntime.getVersion
(GWTRuntime.java:113)
at com.google.gdt.eclipse.core.sdk.AbstractSdk.getDescription
(AbstractSdk.java:53)
at com.google.gdt.eclipse.core.ui.SdkSelectionBlock$6.getText
(SdkSelectionBlock.java:182)
at org.eclipse.jface.viewers.AbstractListViewer.getLabelProviderText
(AbstractListViewer.java:187)
at org.eclipse.jface.viewers.AbstractListViewer.internalRefresh
(AbstractListViewer.java:376)
at org.eclipse.jface.viewers.StructuredViewer$7.run
(StructuredViewer.java:1457)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection
(StructuredViewer.java:1392)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection
(StructuredViewer.java:1353)
at org.eclipse.jface.viewers.StructuredViewer.refresh
(StructuredViewer.java:1455)
at org.eclipse.jface.viewers.StructuredViewer.refresh
(StructuredViewer.java:1414)
at
com.google.gdt.eclipse.core.ui.SdkSelectionBlock.initializeSdkComboBox
(SdkSelectionBlock.java:292)
at com.google.gdt.eclipse.core.ui.SdkSelectionBlock.<init>
(SdkSelectionBlock.java:195)
at com.google.gdt.eclipse.core.ui.ProjectSdkSelectionBlock.<init>
(ProjectSdkSelectionBlock.java:40)
at com.google.gwt.eclipse.core.properties.ui.GWTProjectPropertyPage
$2.<init>(GWTProjectPropertyPage.java:234)
at
com.google.gwt.eclipse.core.properties.ui.GWTProjectPropertyPage.createSdkComponent
(GWTProjectPropertyPage.java:236)
at
com.google.gwt.eclipse.core.properties.ui.GWTProjectPropertyPage.createContents
(GWTProjectPropertyPage.java:114)
at org.eclipse.jface.preference.PreferencePage.createControl
(PreferencePage.java:232)
at org.eclipse.jface.preference.PreferenceDialog.createPageControl
(PreferenceDialog.java:1501)
at org.eclipse.jface.preference.PreferenceDialog$14.run
(PreferenceDialog.java:1258)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.preference.PreferenceDialog.showPage
(PreferenceDialog.java:1252)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage
(FilteredPreferenceDialog.java:679)
at org.eclipse.jface.preference.PreferenceDialog$10.run
(PreferenceDialog.java:708)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:
70)
at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged
(PreferenceDialog.java:704)
at org.eclipse.jface.viewers.StructuredViewer$3.run
(StructuredViewer.java:864)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:888)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged
(StructuredViewer.java:862)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect
(StructuredViewer.java:1175)
at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected
(StructuredViewer.java:1200)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent
(OpenStrategy.java:251)
at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:
245)
at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:419)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:
3855)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.ui.dialogs.PropertyDialogAction.run
(PropertyDialogAction.java:157)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:
3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:
2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault
(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:
149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start
(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run
(EclipseAppHandle.java:194)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication
(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start
(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:179)
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:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


On Dec 14, 9:47 am, hoxbro <shox...@gmail.com> wrote:

> Hi,
>
> Thanks for feedback and sorry for my late reply.
>
> > First, could you try forcing a clean build of your project?  (Project
> > Clean)  This will force a re-indexing of the UiBinder indices.
>
> A clean build removes Eclipse warnings.
> Stopping/Starting Development Mode does the same.
>
> > Also, could you check your Eclipse log for any errors?  The logfile
> > lives at your workspace/.metadata/.log .
>
> Using the Wizard to add a new UiBinder generatesnoentries in the logfile......
>
> > - Which package does your Pjat class live in?
>
> com.hoxbro
>
> > - What version of Eclipse are you using?
>
> java.version=1.6.0_12
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=da_DK
> Framework arguments:  -product org.eclipse.epp.package.jee.product
> Command-line arguments:  -os win32 -ws win32 -arch x86 -product
> org.eclipse.epp.package.jee.product
> Eclipse Build: 20090621-0832
> Eclipse distro: Galileo JEE (win32)
> GWT and GWT Eclipse Plugin installed from Eclipse (following the

> instructionshttp://code.google.com/intl/da/webtoolkit/usingeclipse.html)

Jason Parekh

unread,
Dec 21, 2009, 11:55:22 AM12/21/09
to google-we...@googlegroups.com
Hi Peter,

Thanks for the log, unfortunately there doesn't seem to be anything
relevant there.

Is your project fairly simple? If so, would you be able to zip it up
and send it my way? If not, has this error always been present, or
only after some particular change?

What happens when you clean the project? Do the errors re-appear?

How about if you edit-and-save the ui.xml file and the corresponding
owner java file? Do the errors come back or disappear?

Thanks,
jason

Jason Parekh

unread,
Dec 21, 2009, 11:58:11 AM12/21/09
to google-we...@googlegroups.com
Hi Peter,

Please disregard my reply. I just saw your other message and will ask
you more questions in that thread ( see
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/89f952686038231b#
)

jason

witt_hu

unread,
Jan 11, 2010, 11:16:20 AM1/11/10
to Google Web Toolkit
Hi,

I had the same problem.
Source folder in my buildpath had "Include: (All)"
I replaced it to "Included : **/*.java". It worked correctly.
After than I removed that (so my buildpath had "Include: (All)" again)
and now it is working correctly also.

I hope it's help for you!
(Sorry for my easy sentences, I am learning english ;)

nickajderian

unread,
Jan 13, 2010, 4:09:36 PM1/13/10
to Google Web Toolkit
I also had this problem. I had 2 files:

1. HitTimeSheet/src/TimeSheetItem.ui.xml
2. HitTimeSheet/src/uk.co.hattjoys.hittimesheet.client/
TimeSheetItem.ui.xml

I do not know where 1 came from but I spent 15 minutes editing it and
pulling out my hair before I realised 2 existed. 1 is not needed.
Hope this helps save someone else's hair...

Reply all
Reply to author
Forward
0 new messages