Com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException

I have a problem with my GWT application. I deploy the Jetty server and run it. But when I make a server call (the class on the GWT server package), the server returns an error message. Message:

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, which is fine.

I updated the browser, cleared the browser cache and recompiled the application, but it does not start. What is the solution for this?

Thanks in advance!

Hello!

+5
source share
3 answers

, 7 GWT-RPC, 5. , gwt-servlet.jar / , -.

, gwt-servlet.jar GWT 1.5 2.0 ( 5 GWT-RPC), GWT 2.1 ( 7 ).

+10

( , )

: , : → : com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException message: , . ( 5 , 7.)

: , gwt-user module (jar), . gwt-user jar LIB , Maven EXCLUDE "gwt-user" :

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

, . . :

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

.

Then you need to override the 'service' method from the 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
source

All Articles