GWT IllegalArgumentException:encodedRequest不能为空 [英] GWT IllegalArgumentException: encodedRequest cannot be empty

查看:159
本文介绍了GWT IllegalArgumentException:encodedRequest不能为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用gwt1.5,struts2,spring和hibernate。我收到以下错误:

  ERROR org.apache.catalina.core.ContainerBase。[Catalina]。[localhost]。[ / project name]  - 调度传入的RPC调用时异常调用java.lang.IllegalArgumentException:encodedRequest不能为空

这个错误只发生在IE中,但它在FireFox中工作正常。

解决方案

我已经做了大量的研究在过去几个月内,在我详细介绍之前,我的Web应用程序正在使用运行在Tomcat 7上的GWT 2.x,前端有Apache httpd 2.2.x和mod_jk 1.2.x设置。



使用mod_jk版本1.2.26,我偶尔会看到日志中的encodedRequest不能为空错误。就像问题所说,这只会在IE中发生,对我来说只有IE8 / 9。问题是我的服务器操作系统是Linux,所以没有办法NTLM身份验证可能是问题。在较新版本的mod_jk(在本文中为1.2.37),我将在Tomcat日志中获取套接字超时并读取错误。



此错误将在为了获得在单独的线程中启动的长时间运行的操作的状态,每隔几秒将一个Web应用程序轮询到服务器。轮询将每5秒钟进行一次,但偶尔会在执行此状态请求时挂起。



经过很多tcpdump命令后,我发现挂起的请求将会在由Apache复位的TCP连接上;正在向浏览器发送FIN / ACK,服务器将接收POST请求头和主体,服务器将继续重置连接。然后,奇怪的是,只有标题将从浏览器返回到服务器。经过研究,我发现这一点:





显然,IE只会在POST请求的重发过程中发送头文件。以真正的微软方式,这个问题实际上已经知道了一段时间,发布和安装了一个修补程序,但在客户端机器上未启用。如果您不想强制所有用户编辑其注册表,您需要在服务器上禁用HTTP Keep-Alive,或者将Keep-Alive超时延长至> 60秒。对于我的apache httpd服务器,我将KeepAliveTimeout设置为65,MaxKeepAliveRequests设置为0,以便服务器不会启动连接重置到浏览器。


I am using gwt1.5, struts2, spring and hibernate. I am getting following error:

ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/project name] - Exception while dispatching incoming RPC call java.lang.IllegalArgumentException: encodedRequest cannot be empty

This error only occurs with IE, but it is working perfectly in FireFox.

解决方案

I've done a lot of research into this over the past couple of months - before I get into the details, my web application is using GWT 2.x running on Tomcat 7, with an Apache httpd 2.2.x and mod_jk 1.2.x setup in front.

With mod_jk version 1.2.26, I'd occasionally see the 'encodedRequest cannot be empty' error in the logs. Like the question says, this would only happen in IE, for me only IE8/9. The problem is that my server OS is Linux, so there's no way that NTLM authentication could be the issue. In newer versions of mod_jk (1.2.37 at this writing), I would instead get a socket timeout and read error in the Tomcat logs.

This error would be logged during a polling of my web application to the server every few seconds in order to get the status of a long-running operation that had been launched in a separate thread. The polling would happen every five seconds, but occasionally it would hang while doing this status request.

After a lot of tcpdump commands, I found that the request that hung would come on a TCP connection that was being reset by Apache; a FIN/ACK was being sent to the browser, the POST request header and body would be received by the server, and the server would continue to reset the connection. Then, strangely enough, only the header would come back to the server from the browser. After researching a little, I found this:

Why does Internet Explorer not send HTTP post body on Ajax call after failure?

Apparently, IE will only send the headers during the re-send of the POST request. In true Microsoft fashion, this issue has actually been know about for a while, a hotfix was issued and installed, but NOT ENABLED on the client machine. If you don't want to force all of your users to edit their registry, you need to either disable HTTP Keep-Alive on your server or increase the Keep-Alive timeout to > 60 seconds. For my apache httpd server, I'm setting KeepAliveTimeout to 65 and MaxKeepAliveRequests to 0 so that the server doesn't initiate connection resets to the browser.

这篇关于GWT IllegalArgumentException:encodedRequest不能为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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