5

I have a problem with my GWT application. I deploy on Jetty server and 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!

Jose Hdez
  • 2,297
  • 7
  • 38
  • 52

3 Answers3

10

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

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • I'm getting this error too. Firstly, how do you find out which version RPC version is compatible on your client and server side and how do you change it? – EternallyCurious May 02 '13 at 08:31
  • It's easy: you have to use the exact same version of GWT on both sides; and the exact same version of your app (there are ways around this though; it's about serialization policies) – Thomas Broyer May 02 '13 at 08:35
  • Well, I installed GWT plugin on Eclipse and started developing this project from scratch. Being a single installation, I have no reason to believe that client and server should be incompatible. However, I'm getting the same message as shown in the question above. And I'm running it in dev mode in eclipse and debugging with chrome. – EternallyCurious May 02 '13 at 08:41
  • `IncompatibleRemoteServiceException` can mean many things. Create a new Question with as much information as you can find. – Thomas Broyer May 02 '13 at 08:47
  • Sure! Here you go :) http://stackoverflow.com/questions/16334076/how-to-resolve-an-incompatibleremoteserviceexception-in-gwt – EternallyCurious May 02 '13 at 09:03
1

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

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

Jose Hdez
  • 2,297
  • 7
  • 38
  • 52