IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser
Asked Answered
P

3

6

My GWT Project was working fine but today, after some changes and adding new fetures one async call is not executed. The exception is "This application is out of date, please click the refresh button on your browser." all other async calls are executed.

 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. ( Blocked attempt to access interface 'com.client.FInterface', which is not implemented by 'com.server.FServiceImpl'; this is either misconfiguration or a hack attempt )
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:252)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)

Client :

     public void onClick(ClickEvent event) {

                            fService.getRepositories(repocallback);

        }
    });

Interface

   @RemoteServiceRelativePath("init")
  public interface FInterface extends RemoteService{    

    FCollection getRepositories();
 }

AsyncInterface

  public interface FInterfaceAsync {
void getRepositories(AsyncCallback<FCollection> repositoryCallback);
}

Service

   public class FService implements FInterfaceAsync {
FInterfaceAsync service =(FInterfaceAsync)GWT.create(FInterface.class);
ServiceDefTarget endpoint = (ServiceDefTarget) service;

    public FService(){
    endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "init");
     }
        }

Server

 public class FServiceImpl extends RemoteServiceServlet implements  FInterface {

       public FilnetFolderCollection getRepositories() {
       } 

 }

XML :

   <servlet>
   <servlet-name>FServlet</servlet-name>
  <servlet-class>com.server.FServiceImpl</servlet-class>
  </servlet>

  <servlet-mapping>
  <servlet-name>FServlet</servlet-name>
  <url-pattern>/FServiceImpl</url-pattern>
  </servlet-mapping>

Somebody help me to fix this problem.

Peace answered 1/3, 2012 at 16:35 Comment(0)
F
8

This error is thrown if the Javascript code that is running in the browser is a different version as Javascript deployed on the server. In that case in the JavaScript code in the browser calls a method on the server via Async and that method's number of parameters or parameter types have changed on the server this method is not present as the GWT server side can't find a method with that number of parameters or types, since the methods on the server are newer. This can happen if the browser still has the GWT Javascript cached and when you start the browser it won't load the new JavaScript files from the server, but takes the local files from cache. By forcing the browser with Ctrl-F5 to refresh the local cached version in the browser will be gone as the new version from the server will be retrieved and this problem should be fixed. In production this problem can be caused if the cache settings of the webserver or java server not set to invalidate the nocache file. See also http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#perfect_caching

Fabio answered 1/3, 2012 at 20:51 Comment(0)
D
1

The error can be resolved by one the following ways:

  1. clearing browser cache
  2. clearing web-server cache
  3. clearing class files and rebuilding your project. You can rebuild your project by running "clean" and "install" phases of maven or "Build -> Rebuild Project" menu of IntellijIdea and "Project -> Clean" menu in Eclipse.
Denishadenison answered 16/9, 2017 at 14:8 Comment(1)
Step 3 worked for me. Apparently some stale files were causing the conflicts.Ecdysis
B
0

After making server side changes in your code you need to relaunch the project or reload the webserver.. It would resolve the issue

Budding answered 21/3, 2013 at 7:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.