如何解决GWT中的IncompatibleRemoteServiceException? [英] How to resolve an IncompatibleRemoteServiceException in GWT?

查看:123
本文介绍了如何解决GWT中的IncompatibleRemoteServiceException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过Eclipse插件创建了一个新的GWT项目 - 只是试图调用这个服务器端函数。我删除了使用生成的代码创建的初始问候函数 - 并将其替换为另一个函数QueryResponse search(QueryRequest query)。但是,当客户端调用函数时出现此错误。虽然生成的示例greet函数正在从GWT SDK中的某个地方调用。 b $ b [WARN] greetServlet:处理此调用时抛出IncompatibleRemoteServiceException
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException:此应用程序已过期,请单击浏览器上的刷新按钮(无法通过com.google.gwt.user.server.rpc.RPC在接口com.myproject.client.GreetingService)
中找到请求的方法'greetServer(com.myproject.shared.QueryRequest)'。 decodeRequest(RPC.java:310)
,位于com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
。在com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)在com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost
(AbstractRemoteServiceServlet.java:62 )
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org。 mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
处org.mortbay.jetty org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
。 security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler。在org.mortbay.jetty.webapp.WebAppContext.handle处理(ContextHandler.java:729)
(WebAppContext.java:405)
在org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper。 java:152)
at org.mortbay.jetty.handler.Re (org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server。的java:324)$在org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
。在org.mortbay.jetty.HttpConnection $ RequestHandler.content(HttpConnection.java:843)$ b b $ b在org.mortbay.jetty.HttpParser.parseAvailable在org.mortbay.jetty.HttpParser.parseNext $ b(HttpParser.java:647)
(HttpParser.java:211)
在org.mortbay.jetty .HttpConnection.handle(HttpConnection.java:380)
在org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
在org.mortbay.thread.QueuedThreadPool $ PoolThread.run (QueuedThreadPool.java:488)

编辑:今天制成。该错误不会显示该通话何时未被事件触发。具体来说,这个电话是在提交表格时提出的。今天,我尝试删除表单提交部分,只是在调用onmodule加载函数时进行调用 - 并且它工作正常。从服务器返回适当的结果。但是,当我将它放回到表单提交事件中时,就会显示此错误。不仅如此 - 每当提交表单时都会显示此错误 - 是否触发服务器调用。如果您提交表单一次,则会显示错误。第一个错误发生后,即使您尝试刷新页面,它也会显示。

解决方案

我有同样的问题,我最终通过删除WEB-INF \ classes的内容来修复它,因为它正在缓存一些旧东西。



显然,也要尝试清理C:\ Users。 .. \AppData\Local\Temp因为这是一个常见的GWT问题..


I've created a new GWT project through the Eclipse plugin - and just trying to call this server side function. I deleted the initial "greet" function which was created with the generated code - and replaced it with another function "QueryResponse search(QueryRequest query). But then I'm getting this error when the client calls the function. It appears to me as though the generated sample "greet" function is being called from somewhere inside the GWT SDK. Help!

Starting Jetty on port 8888
[WARN] greetServlet: 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. ( Could not locate requested method 'greetServer(com.myproject.shared.QueryRequest)' in interface 'com.myproject.client.GreetingService' )
    at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:310)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

EDIT: Here's and interesting observation I made today. The error does not show when the call is not fired by an event. To be specific, this call was made when a form was submitted. Today I tried removing the form submission part and just make the call when the onmodule load function is called - and it worked fine. The appropriate result was returned from the server. But when, I put it back inside the form submit event, this error shows up. Not just that - this error shows up whenever the form is submitted - whether or not a server call is triggered. If you submit the form once, the error shows up. After the first error, it shows up even when you try to refresh the page.

解决方案

I had the same problem, I eventually fixed it by deleting the contents of WEB-INF\classes as it was caching up some old stuff in there.

Obviously also try clearing down C:\Users...\AppData\Local\Temp as that is a common GWT problem..

这篇关于如何解决GWT中的IncompatibleRemoteServiceException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆