com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException

|| 我的GWT应用程序有问题。我部署在Jetty服务器上,并且可以运行。但是,当我执行服务器调用(GWT服务器程序包上的类)时,服务器返回错误消息。消息是:
7|0|6|http://localhost/zbapp/zb_app/|A31E1254E17F9AD731856D6BE34124A2|main.java.com.gwt.app.client.GreetingService|greetServer|java.lang.String/2004016611||1|2|3|4|2|5|5|6|6|
//EX[2,1,[\"com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533\",\"This application is out of date, please click the refresh button on your browser. ( Expecting version 5 from client, got 7. )\"],0,5]
但是,服务器返回一个200的代码,可以。 我已经更新了浏览器,清理了浏览器缓存并重新编译了该应用程序,但是它没有运行。有什么解决方案? 提前致谢! 问候!     
已邀请:
您的客户端是最新的,因为它使用GWT-RPC协议的版本7发送请求,但是服务器需要版本5。请检查您是否部署了正确的gwt-servlet.jar版本,和/或未部署正确的版本。您的服务器类路径中有一个较旧的版本,而不是您的webapp中使用的那个版本。 更具体地说,您的GWT 2.1或更高版本(协议的版本7)已编译了客户端代码,而GWT的gwt-servlet.jar在1.5和2.0之间(GWT-RPC协议的版本5)。     
解决的问题(至少是我的版本) 错误: 处理此调用时引发的异常:未知方法->异常:com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException 消息:此应用程序已过期,请单击浏览器上的刷新按钮。 (期望客户端提供第5版,得到7。) 解: 在gwt-user模块(jar)中查找哪个依赖项,因为这可能是问题的原因。首先验证删除 LIB文件夹中的gwt-user jar解决了问题,然后您也可以修改Maven以对\'gwt-user \'使用EXCLUDE,如下所示:
<dependency>
    <groupId>com.google.gwt.google-apis</groupId>
    <artifactId>gwt-visualization</artifactId>
    <version>1.0.2</version>
    <exclusions>
        <exclusion>
          <groupId>com.google.gwt</groupId>
          <artifactId>gwt-user</artifactId>
        </exclusion>
        </exclusions>
</dependency>
    
我已经更改了库,错误消失了。但是,错误会更改。现在我的错误是:
//EX[2,1,[\"com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException/3936916533\",\"Could not locate requested interface \'main.java.com.gwt.app.client.GreetingService\' in default classloader\"],0,7]
但是该接口在classloader中。 然后,需要从HttpServlet覆盖方法\'service \':
@Override 
protected void service(HttpServletRequest req, HttpServletResponse resp) 
        throws ServletException, IOException { 
    // Cache the current thread 
    Thread currentThread = Thread.currentThread(); 
    // We are going to swap the class loader 
    ClassLoader oldContextClassLoader = 
    currentThread.getContextClassLoader(); 
    currentThread.setContextClassLoader(this.getClass().getClassLoader()); 
    super.service(req, resp); 
    currentThread.setContextClassLoader(oldContextClassLoader); 
} 
因此,该应用程序在Equinox上运行!!     

要回复问题请先登录注册