IncompatibleRemoteServiceException:此应用程序已过时,请单击浏览器上的刷新按钮 [英] IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser

查看:174
本文介绍了IncompatibleRemoteServiceException:此应用程序已过时,请单击浏览器上的刷新按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的GWT项目工作正常,但今天,经过一些改变,并添加新的fetures一个
异步调用不执行。例外情况是此应用程序的日期为
,请点击浏览器上的刷新按钮。所有其他的
异步调用都会被执行。

 处理此调用时抛出IncompatibleRemoteServiceException。 
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException:此应用程序已过期,请单击浏览器上的刷新按钮。 (阻止尝试访问'com.server.FServiceImpl'实现的接口'com.client.FInterface';这可能是配置错误或黑客攻击)
在com.google.gwt.user.server .rpc.RPC.decodeRequest(RPC.java:252)
位于com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
位于com.google.gwt .user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)

客户端: p>

  public void onClick(ClickEvent event){

fService.getRepositories(repocallback);

}
});

界面

  @RemoteServiceRelativePath(init)
public interface FInterface extends RemoteService {

FCollection getRepositories();

$ / code>

AsyncInterface

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

服务

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

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

服务器

  public class FServiceImpl extends RemoteServiceServlet implements FInterface {
$ b $ 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>

有人帮我解决了这个问题。

在这种情况下,浏览器中的JavaScript代码通过Async调用服务器上的方法,并且在服务器上该方法的参数或参数类型数量已更改,因此此方法不存在,因为GWT服务器端无法找到具有该方法的方法由于服务器上的方法较新,因此参数或类型数量较多。如果浏览器仍然具有缓存的GWT Javascript,并且启动浏览器时它不会从服务器加载新的JavaScript文件,但从缓存中获取本地文件,则可能会发生这种情况。通过使用Ctrl-F5强制浏览器刷新浏览器中的本地缓存版本将消失,因为将从服务器获取新版本,并且应该修复此问题。在生产中,如果Web服务器或Java服务器的缓存设置未设置为使nocache文件无效,则可能导致此问题。另请参阅 http://code.google.com/webtoolkit/doc/latest /DevGuideCompilingAndDebugging.html#perfect_caching


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.

解决方案

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

这篇关于IncompatibleRemoteServiceException:此应用程序已过时,请单击浏览器上的刷新按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆