gpt4 book ai didi

java - IncompatibleRemoteServiceException : This application is out of date, 请点击浏览器的刷新按钮

转载 作者:搜寻专家 更新时间:2023-10-31 19:40:58 37 4
gpt4 key购买 nike

我的 GWT 项目运行良好,但今天,经过一些更改和添加新功能后不执行异步调用。异常(exception)情况是“此应用程序已过期日期,请单击浏览器上的刷新按钮。”所有其他执行异步调用。

 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)

客户:

     public void onClick(ClickEvent event) {

fService.getRepositories(repocallback);

}
});

界面

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

FCollection getRepositories();
}

异步接口(interface)

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

服务

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

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

服务器

 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>

有人帮我解决这个问题。

最佳答案

如果浏览器中运行的 Javascript 代码与服务器上部署的 Javascript 代码版本不同,则会抛出此错误。在这种情况下,浏览器中的 JavaScript 代码通过 Async 调用服务器上的方法,并且该方法的参数数量或参数类型在服务器上发生了变化,因为 GWT 服务器端找不到该方法,所以该方法不存在参数或类型的数量,因为服务器上的方法较新。如果浏览器仍然缓存了 GWT Javascript,并且当您启动浏览器时,它不会从服务器加载新的 JavaScript 文件,而是从缓存中获取本地文件,就会发生这种情况。通过使用 Ctrl-F5 强制浏览器刷新浏览器中的本地缓存版本将消失,因为将从服务器检索新版本并且应该修复此问题。在生产中,如果 Web 服务器或 Java 服务器的缓存设置未设置为使 nocache 文件无效,则可能会导致此问题。另见 http://code.google.com/webtoolkit/doc/latest/DevGuideCompilingAndDebugging.html#perfect_caching

关于java - IncompatibleRemoteServiceException : This application is out of date, 请点击浏览器的刷新按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9520159/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com