开发者

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

I have a problem with my GWT application. I deploy on Jetty server an开发者_如何学God it runs. But when I perform a server call (class on server package of GWT), the server returns an error message. The message is:

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]

However, the server returns a 200 code that is OK.

I have updated the browser, clear up browser cache and recompiled the application, but it does not run. What is the solution for that??

Thanks in advance!

Regards!


Your client is uptodate, as it sends a request using version 7 of the GWT-RPC protocol, but the server expects version 5. Check that you deployed the correct version of gwt-servlet.jar, and/or that you don't have an older version in your server classpath that would be used instead of the one from your webapp.

More specifically, you have a gwt-servlet.jar from GWT between 1.5 and 2.0 (version 5 of the GWT-RPC protocol) while your client code has been compiled with GWT 2.1 or newer (version 7 of the protocol).


PROBLEM SOLVED (at lest my version of it)

ERROR: Exception thrown while processing this call: unknown method -> Exception: com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException message: This application is out of date, please click the refresh button on your browser. ( Expecting version 5 from client, got 7. )

SOLUTION: Look for which dependency is pulling in gwt-user module (jar), because that is the likely cause of the problem. First verify deleting the gwt-user jar from your LIB folder fixes problem, and then you can also modify your Maven to use an EXCLUDE for 'gwt-user' as follows:

<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>


I have changed the libraries and the error is disappeared. However, the error changes. Now my error is:

//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]

But the interface is in classloader.

Then, it is needed to override method 'service' from HttpServlet:

@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); 
} 

Thus, the application runs on Equinox!!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜