Tuesday, November 6, 2007

Frustrating: GWT InvocationException

I am having some success with GWT - but here's one that took me a couple hours to figure out. I created an asynchronous RPC service. Pretty much straight from the "book". Wouldn't work - wouldn't work. Tore everything back to the bare bones. (OK - the service was taking a user-defined class as an argument and returning a list.) I changed it to take a String and return a String. Still always got the InvocationException - with no cause. Finally also ripped the RemoteServiceServlet back to the basics -- did I mention I implemented the init and service methods to allow setting up other stuff I needed? Lo and behold it started working! Doh!
In the simple minded version I originally wrote it wasn't going to actually service anything, just initialize. By calling super.service(request, response) things went much better. Sometimes it IS just the simple problems.

3 comments:

Unknown said...

Just leaving a hint for people who find this while fighting the same issue I had.

If you're on MsWin and getting this exception, make sure that IE is not set to 'Work Offline' This setting is under IE's File menu and can cause the RPC to fail.

It's also what causes that little dialog claiming you're not connected to the net, when you know you are.

Hanif said...

I also have difficulties solving this InvocationException but could not understand your solution..

Hope you could share some code..

Unknown said...

Sorry xZx, that was quite a while and many projects ago... good luck.