I've done this successfully using gwt-uibinder-mock but it no longer works in gwt 2.4.
Does anyone know of a simple way to structure a uib class to avoid the following error when running in junit?
java.lang.ExceptionInInitializerError
at com.netuitive.gwt.portal.client.portal.PortalUIB$$FastClassByGuice$$504f2a91.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
..
Caused by: java.lang.UnsupportedOperationException: ERROR: GWT.create() is only usable in client code! It cannot be called, for example, from server code. If you are running a unit test, check that your test case extends GWTTestCase and that GWT.create() is not called from within an initializer or constructor.
at com.google.gwt.core.client.GWT.create(GWT.java:92)
at com.google.gwt.user.client.ui.UIObject.<clinit>(UIObject.java:188)
... 39 more
Here is how I structire the UIB class now:
public class TheUIB extends Composite {
interface MyUiBinder extends UiBinder<Widget, TheUIB > {}
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
public TheUIB() {
super();
initWidget(uiBinder.createAndBindUi(this));
}
thanks,
David
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