RuntimeException: GWT has not been properly initialized - RPC failure!

16 views
Skip to first unread message

Andrewww

unread,
May 24, 2007, 3:39:59 AM5/24/07
to Google Web Toolkit
I made an RPC with the task to load on the server an ontology model
using Jena libraries.
When I launch the application in hosted mode, I have:

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[WARN] StandardContext[]Exception while dispatching incoming RPC call
java.lang.ExceptionInInitializerError: null
at com.google.gwt.user.client.ui.Image.<init>(Image.java:66)
at com.google.gwt.user.client.ui.Image.<init>(Image.java:77)
at com.mycompany.project.server.KB.<clinit>(KB.java:34)
at com.mycompany.project.server.ModelImpl.loadModel(ModelImpl.java:
15)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
281)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
Caused by: java.lang.RuntimeException: GWT has not been properly
initialized; if you are running a unit test, check that your test case
extends GWTTestCase
at com.google.gwt.core.client.GWT.create(GWT.java:65)
at com.google.gwt.user.client.DOM.<clinit>(DOM.java:38)
at com.google.gwt.user.client.ui.Image.<init>(Image.java:66)
at com.google.gwt.user.client.ui.Image.<init>(Image.java:77)
at com.mycompany.project.server.KB.<clinit>(KB.java:34)
at com.mycompany.project.server.ModelImpl.loadModel(ModelImpl.java:
15)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
281)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Why it throws this exception? Is there any GWT configuration problem
or issues with GWT.create? I don't ecplicitly use the method
GWT.create() in my code on the server side. But I have observed that
if I remove the instruction (a fundamental instruction for my app):

model =
ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);

the error disappears! :S

George Georgovassilis

unread,
May 24, 2007, 4:25:09 AM5/24/07
to Google Web Toolkit
Erm... can you have an Image inside your model? I suspect that you are
initialising an Image instance on your server... that makes no sence,
it need a browser environment to run in, it needs a DOM tree etc...

Andrewww

unread,
May 24, 2007, 4:51:45 AM5/24/07
to Google Web Toolkit
No, I solved in a an other way. Instead of let my function load some
data into static variables declared in an interface, now I load the
data I need in local variables, and then I copy it into static members
of a class created for this purpose.
I don't still know why It didn't work before...

George Georgovassilis

unread,
May 24, 2007, 5:10:17 AM5/24/07
to Google Web Toolkit
Your stacktrace shows that you are initialising an Image on the server
side. Try doing that:

public static void main(String args[]){
Image image = new Image();
}

it will crash instantly. If your image is a member of a static
interface which is used on the server, it amounts to the same thing:
once the class is loaded, the image is instantiated and an exception
is thrown. I don't think there is any way you can make that work (by
the way, why do you need an image as a constant in an interface
anyway?)

Reply all
Reply to author
Forward
0 new messages