What causes "Deferred binding failed for class" errors?

1,249 views
Skip to first unread message

laredotornado

unread,
Dec 5, 2011, 10:52:35 AM12/5/11
to Google Web Toolkit
Hi,

I'm using GWT 2.4. I'm trying to run some GWTTestCases in an
environment and getting "Deferred binding failed for class" errors.
How do I figure out what resource GWT is looking for? For a number of
my tests, GWT dies with the following error log ...


Rebinding com.myco.clearing.product.client.resource.Resources.Images
Invoking generator
com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
Preparing method cellTreeItemImage
Finding resources
[ERROR] No com.google.gwt.resources.client.ClientBundle
$Source annotation and no resources found with default extensions
Preparing method cellTreeLeafItemImage
Finding resources
[ERROR] No com.google.gwt.resources.client.ClientBundle
$Source annotation and no resources found with default extensions
[ERROR] Deferred binding failed for
'com.myco.clearing.product.client.resource.Resources.Images'; expect
subsequent failures


Below is the class in question. The relevant files appear to be in
the classpath. Is there anything I can do to get GWT to tell me more
about what's ailing it?

Thanks, - Dave


public class Resources {
public interface Styles extends CssResource {
String categoryPanel();

String productDetailsPanel();

String contextMenu();

String productDetailsHeader();

String COMMON_CSS = "com/myco/clearing/product/client/resource/
common.css";
}

public interface Images extends ClientBundle {
ImageResource cellTreeItemImage();

ImageResource cellTreeLeafItemImage();

@NotStrict
@Source( Styles.COMMON_CSS )
Styles styles();
}

private static Images resources;

static {
resources = GWT.create( Images.class );
resources.styles().ensureInjected();
}

public static Styles styles() {
return resources.styles();
}

public static Images images() {
return resources;
}
}

Ed

unread,
Dec 6, 2011, 4:33:13 AM12/6/11
to Google Web Toolkit
Some tips:
1) Make sure the sources (besides the classes) are present on your
classpath.
2) Use the @Source annotation to define the picture file and make sure
the path it correct.
@Source("cellTreeItemImage.png")
ImageResource cellTreeItemImage();
In this example the picutre has to be present in the same package.
3) Stay away from GWTTestCase unless realllly necessary.
For general GWT testing tips, see:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/87030a9ae66fe012/

Does it work in dev mode?

Reply all
Reply to author
Forward
0 new messages