weblogic中 java.net.SocketException: Connection reset

来源:互联网 发布:千牛mac版不能用了吗 编辑:程序博客网 时间:2024/05/16 23:44
 

weblogic中 java.net.SocketException: Connection reset

关于:java.net.SocketException: Connection reset
关键信息:一个请求中包含了两个POST数据包
以前经常听说关于这个错误,没有太多在意,认为我写的框架应该没有问题,第一感觉是网络不稳定产生的。
今天在一次偶尔的测试中,发现这个问题频繁的出现:
java.net.SocketException: Connection reset
 at java.net.SocketInputStream.read(SocketInputStream.java:168)
 at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:170)
 。。。 。。。
--------------- nested within: ------------------
weblogic.utils.NestedRuntimeException: Cannot parse POST parameters of request: '/beacon/txn993101.do' - with nested exception:
[java.net.SocketException: Connection reset]
 at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletRequestImpl.java:1277)
 。。。 。。。
起初怀疑是服务端的问题,经过一番努力,确认doPost已经正常结束,并且在我控制不了的地方,立刻又发起了另一个doPost,第二个doPost的处理中,Weblogic认为连接已经关闭,所以才出了上面的错误
根据这个现象,怀疑是IE在提交的数据里面,包含了两个POST请求,好象不可思议,至少我认为不会产生这种低级错误。
进一步的测试发现,通过 <BUTTON onclick="forms[X].submit"> 的请求是正常的,而 <INPUT onkeydown="forms[X].submit"> 的请求,肯定会有上面的错误,当然具体的代码要复杂的多。
在代理服务器上看到的信息,后一个请求确实包含了两个POST数据包,如下:
POST /beacon/txn993101.do HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://169.1.1.185:7001/beacon/freeze.main?txn-code=show&path=/module/console/error-report&page=/txn993101.do&cmd=′??′′|mμ?
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Pragma: no-cache
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; InfoPath.1)
Host: 169.1.1.185:7001
Content-Length: 480
Proxy-Connection: Keep-Alive
Cookie: JSESSIONID=EbNUakFYENcyMF6x3s10OsgWyrFuk9yCMGnhr2U4hgZkBInx00nW!860387529
Close Http Link[169.1.1.185:7001][http://169.1.1.185:7001/beacon/txn993101.do]
POST /beacon/txn993101.do HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://169.1.1.185:7001/beacon/freeze.main?txn-code=show&path=/module/console/error-report&page=/txn993101.do&cmd=′??′′|mμ?
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
UA-CPU: x86
Pragma: no-cache
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; InfoPath.1)
Host: 169.1.1.185:7001
Content-Length: 480
Proxy-Connection: Keep-Alive
Cookie: JSESSIONID=EbNUakFYENcyMF6x3s10OsgWyrFuk9yCMGnhr2U4hgZkBInx00nW!860387529

inner-flag%3Aflowno=11552227467156&inner-flag%3Aopen-type=window&inner-flag%3Amodify-flag=true&inner-flag%3Areload-flag=yes&inner-flag%3Acontinue-flag=yes&inner-flag%3Anext-page=&inner-flag%3Asuccess-hint=&inner-flag%3Afailure-hint=&inner-flag%3Aload-node=&inner-flag%3Amenu-name=&inner-flag%3Asuccess-number=1&attribute-node%3Arecord_selected-key=&attribute-node%3Arecord_record-number=11&record_selectPage=1&attribute-node%3Arecord_page-row=5&attribute-node%3Arecord_start-row=1
而前一个请求只包含一个POST数据包,问题得到了确认,那应该是javascript的代码有问题,修改是很简单的,INPUT的event中return false就可以了,例如:
<INPUT onkeydown="forms[X].submit;return false;">
原创粉丝点击