0

A form submit event in GWT and GQuery is causing an IncompatibleRemoteServiceException. This project includes GQuery (GWT version of JQuery) which is used to call the form submit. Here's the code for it. The event is inserted in onmoduleload function:

$("#search_form").submit(new Function(){
    public void f() {
    QueryRequest query = new QueryRequest();
    String keywords = $("#keyword_search_box").val();
    query.setKeywords(keywords);
    greetingService.search(query, new AsyncCallback<QueryResponse>() {

            @Override
            public void onFailure(Throwable caught) {
                Window.alert(COUNLDNT_REACH_SERVER);
        }

        @Override
        public void onSuccess(QueryResponse result) {
            $("#page").add(renderResponse(result));
        }
    });
    }
});

The exception shows up whenever the submit button is clicked. If the server call is made from outside the submit event, it works fine - otherwise public void onFailure(Throwable caught) is executed. Here's the exception:

Starting Jetty on port 8888
   [WARN] greetServlet: An IncompatibleRemoteServiceException was thrown while processing this call.
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. ( Could not locate requested method 'greetServer(com.project.shared.QueryRequest)' in interface 'com.project.client.GreetingService' )
    at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:310)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
EternallyCurious
  • 2,345
  • 7
  • 47
  • 78

1 Answers1

0

Most possible reason is jars version.

Check if the gwt-servlet.jar is uptodate. The gwt-user.jar and gwt-servlet.jar must have the same version.

see A discussion here on the same.

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307