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?
On Dec 5, 4:52 pm, laredotornado <laredotorn...@zipmail.com> wrote:
> 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;
> }
>
>
>
>
>
>
>
> }
--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment