Hi.  I am getting IncompatibleRemoteServiceException where I am not
expecting it, and was hoping you could shed some light at the cause.

I have a Proxy class (please see below), where all the ajax calls
happen over the same service instance (MyServiceProxy.service()
call).  Each of the calls has its own MyServiceCallback
implementation, so it handles its own success and failure.

What I have been seeing is as follows:  on some server restarts we get
success in one of the callback, and failure (with
IncompatibleRemoteServiceException) in another callback.  I cannot
seem to be able to reproduce it on-demand, it just happens sometimes.
Looking at the documentation it seems to be some sort of "catch-all"
for serialization issues.  But in this case my server code is often
times not changed (the server just gets restarted).  Also, when I see
this problem, if I open up another browser, it works fine.  Therefore,
none of the bullet points in the docs seem to explain it.

Documentation says to reload the page as the solution, which is not a
problem; I just want to get to the cause and understand what the
problem really is.  Is there anything I'm missing?  Any help is
greatly appreciated.

Thank you!
     -Vicky


public final class MyServiceProxy
{

        private static int _connectionErrorCount;

        private static MyServiceAsync MY_SERVICE = null;

        private MyServiceProxy()
        {
        }

        public static MyServiceAsync service()
        {
                if (MY_SERVICE == null)
                {
                         MY_SERVICE = (MyServiceAsync) 
GWT.create(MyService.class);
                }

                return MY_SERVICE;
        }

        /** The number of connection failures that have occurred in a row.
Reset upon success. **/
        public static int getErrorCount()
        {
                return _connectionErrorCount;
        }

        public static abstract class MyServiceCallback<E> implements
AsyncCallback<E>
        {

                @Override
                public final void onFailure(Throwable caught)
                {
                        _connectionErrorCount++;
                        failure(caught);
                }

                @Override
                public final void onSuccess(E result)
                {
                        _connectionErrorCount = 0;
                        success(result);
                }

                public abstract void success(E result);

                public abstract void failure(Throwable caught);

        }
}


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to