Error : GWT.create() is only usable in client code!

1,201 views
Skip to first unread message

Niks

unread,
Jul 14, 2008, 8:18:54 AM7/14/08
to Google Web Toolkit
When i am using the java class in which main method is their and in
that when i am
calling the method for getting data from database i am getting this
error


java.lang.RuntimeException: 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, constructor, or
setUp()/tearDown().
at
com.shrisure.client.scheme.screen.ParsingFileNew.populateAgent(ParsingFileNew.java:
152)
at
com.shrisure.client.scheme.screen.ParsingFileNew.main(ParsingFileNew.java:
93)
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, constructor, or setUp()/tearDown().
at com.google.gwt.core.client.GWT.create(GWT.java:64)
at
com.shriram.client.ServiceUtil.getHibernateServiceAsync(ServiceUtil.java:
12)
at
com.shrisure.client.utils.HibernateImplUtils.findObjects(HibernateImplUtils.java:
31)
at
com.shrisure.client.scheme.screen.ParsingFileNew.populateAgent(ParsingFileNew.java:
107)
... 1 more
Exception in thread "main"


This is when i am using it with Openrules . All classes and interface
are in Clent side than why this error is coming can anybody resolve
this issue....

LeicesterTiger

unread,
Jul 15, 2008, 5:03:55 AM7/15/08
to Google Web Toolkit
I had that problem when I was trying to use a client class (by
inheritance) on the server that had a reference to a GWT constants
class for getting internationalized properties.
Reply all
Reply to author
Forward
0 new messages