RPC problem?

27 views
Skip to first unread message

Brito

unread,
Oct 21, 2011, 6:50:25 AM10/21/11
to Google Web Toolkit
RPC that is working fine in host mode but fails in web mode
and I don't know what to do to troubleshoot it. On the client, I get a
message box that says "Failure:
com.google.gwt.user.client.rpc.StatusCodeException: The call failed on
the server; see server log for details".

Thomas Broyer

unread,
Oct 21, 2011, 6:55:42 AM10/21/11
to google-we...@googlegroups.com
Have you looked at your server logs? What's the status code? (use Firebug or whatever to see what the server responds: 404 → the RemoteServiceRelativePath is wrong and/or you have an issue in how you deployed your app; 500 → there was another error on the server, maybe you reached a non-RPC servlet; 405 → you reached something that doesn't accept POSTs, so it's not your RPC servlet)

Sean

unread,
Oct 21, 2011, 7:56:55 AM10/21/11
to google-we...@googlegroups.com
I also recommend creating a Serialized Exception, and have ALL your RPCs do adequate error handling and throw these Serialized Exceptions for display on your page. This has made RPC debugging 3000x better. 

András Csányi

unread,
Oct 21, 2011, 8:09:56 AM10/21/11
to google-we...@googlegroups.com

Sean, it sounds really good, but I'm very new at GWT and java as well.
So, would you so kind to provide a simple example which is usable?

Many thanks in advance!

--
- -
--  Csanyi Andras (Sayusi Ando)  -- http://sayusi.hu --
http://facebook.com/andras.csanyi
--  ""Trust in God and keep your gunpowder dry!" - Cromwell

Sudhakar Abraham

unread,
Oct 21, 2011, 8:47:02 AM10/21/11
to Google Web Toolkit
Your tomcat mapping may be incorrect as it cannot find the url mapping
for the RemoteServiceServlet you are calling. See the error on
"Apache Software Foundation\Apache Tomcat 6.0.18\logs\catalina.
2011-01-21.log" directory. Check your StatusCode of Http response.

S. Abraham
www.DataStoreGwt.com
Persist objects directly in Google App Engine

Thad

unread,
Oct 24, 2011, 6:10:18 PM10/24/11
to Google Web Toolkit
I uses a serialized exception. The class looks something like:

public class GwtAppException extends Exception implements Serializable
{
public GwtAppException() {
super();
// my code follows
}
public GwtAppException(String message) {
super(message);
// my code follows
}
... etc.
}

Put this somewhere that it complies for both client and server (the
way your RemoteServices do). Declare your RemoteServices methods to
throw this error.

In you client code,

AsyncCallback<String> callback = new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
Window.alert((new GwtAppException(caught)).getMessage());
}
...

On Oct 21, 8:09 am, András Csányi <sayusi.a...@gmail.com> wrote:
> On 21 October 2011 13:56, Sean <slough...@gmail.com> wrote:
>
> > I also recommend creating a Serialized Exception, and have ALL your RPCs do
> > adequate error handling and throw these Serialized Exceptions for display on
> > your page. This has made RPC debugging 3000x better.
>
> Sean, it sounds really good, but I'm very new at GWT and java as well.
> So, would you so kind to provide a simple example which is usable?
>
> Many thanks in advance!
>
> --
> - -
> --  Csanyi Andras (Sayusi Ando)  --http://sayusi.hu--http://facebook.com/andras.csanyi
Reply all
Reply to author
Forward
0 new messages