控制台报Connection reset问题(转)

最近启动tomcat时总是报有一些错,一开始没怎么注意,因为对项目操作没什么大的影响,今天闲下来看了看。

 

[2011-02-28 10:36:01] - getParameters()


org.apache.commons.fileupload.FileUploadException: Connection reset


	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:381)


	at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)


	at eg.java.net.web.jspx.engine.util.RequestUtil.getParameters(RequestUtil.java:44)


	at eg.java.net.web.jspx.ui.pages.Page.loadMultiPartForm(Page.java:394)


	at eg.java.net.web.jspx.ui.pages.Page.continueServing(Page.java:220)


	at eg.java.net.web.jspx.engine.RequestHandler.start(RequestHandler.java:156)


	at eg.java.net.web.jspx.engine.RequestHandler.doPost(RequestHandler.java:63)


	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)


	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)


	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)


	at com.inspur.filter.CharsetFilter.doFilter(CharsetFilter.java:53)


	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)


	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)


	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)


	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)


	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)


	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)


	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)


	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)


	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)


	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)


	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)


	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)


	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)


	at java.lang.Thread.run(Thread.java:595)


Caused by: java.net.SocketException: Connection reset


	at java.net.SocketInputStream.read(SocketInputStream.java:168)


	at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:748)


	at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:778)


	at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)


	at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:713)


	at org.apache.coyote.Request.doRead(Request.java:419)


	at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:264)


	at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:403)


	at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:279)


	at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)


	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)


	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)


	at java.io.InputStream.read(InputStream.java:89)


	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94)


	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)


	at org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStream.java:593)


	at org.apache.commons.fileupload.MultipartStream.discardBodyData(MultipartStream.java:619)


	at org.apache.commons.fileupload.MultipartStream.skipPreamble(MultipartStream.java:638)


	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:961)


	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:942)


	at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)


	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:349)


	... 25 more


Caused by:


java.net.SocketException: Connection reset


	at java.net.SocketInputStream.read(SocketInputStream.java:168)


	at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:748)


	at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:778)


	at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)


	at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:713)


	at org.apache.coyote.Request.doRead(Request.java:419)


	at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:264)


	at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:403)


	at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:279)


	at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)


	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:977)


	at org.apache.commons.fileupload.MultipartStream$ItemInputStream.read(MultipartStream.java:887)


	at java.io.InputStream.read(InputStream.java:89)


	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:94)


	at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)


	at org.apache.commons.fileupload.MultipartStream.readBodyData(MultipartStream.java:593)


	at org.apache.commons.fileupload.MultipartStream.discardBodyData(MultipartStream.java:619)


	at org.apache.commons.fileupload.MultipartStream.skipPreamble(MultipartStream.java:638)


	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.findNextItem(FileUploadBase.java:961)


	at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:942)


	at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331)


	at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:349)


	at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)


	at eg.java.net.web.jspx.engine.util.RequestUtil.getParameters(RequestUtil.java:44)


	at eg.java.net.web.jspx.ui.pages.Page.loadMultiPartForm(Page.java:394)


	at eg.java.net.web.jspx.ui.pages.Page.continueServing(Page.java:220)


	at eg.java.net.web.jspx.engine.RequestHandler.start(RequestHandler.java:156)


	at eg.java.net.web.jspx.engine.RequestHandler.doPost(RequestHandler.java:63)


	at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)


	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)


	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)


	at com.inspur.filter.CharsetFilter.doFilter(CharsetFilter.java:53)


	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)


	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)


	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)


	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)


	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)


	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)


	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)


	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)


	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)


	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)


	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)


	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)


	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)


	at java.lang.Thread.run(Thread.java:595)

 网上一些说法:

1,网络编程时未正确捕获java.net.SocketException,客户端先关闭就会报这个异常;
2,数据库和应用服务器的网段不同.

b。好像说防火墙的比较多。。。。

大部分是网络的原因。提交post的东西多,然后服务器接收就超时了。。。

c。如果weblogic server和数据库服务器不在同一台主机,会经常有这种情况,我也遇到过,不过好像的确不怎么影响使用



d。从根本上说是weblogic sp2的bug


e。一般是有些客户端已关闭,一些线程因为延迟等原因觉察不到此连接已结束,继续等到到出错或是 客户端那里不停刷或一个访问/刷新没完成前再刷,要让这个无用的线程死掉和这个错误如果不影响应用运行的话大可不必理会。有一种抛出这个异常的情况是:

浏览器请求了一个服务器端资源,在响应回来之前转而请求其他的资源。这个时候最初的浏览器跟服务器的连接中断,服务器的peer程序就会reset那个connection。

 

 

我的Tomcat是在本机启动的,而DB2数据库是用的虚拟机里的,不在一个网段,可能是这个原因吧。把应用部署到虚拟机上,错误消失。

但断掉网线,本机和虚拟机就在一个网段里了,但是依然报错,郁闷。

 

展开阅读全文

没有更多推荐了,返回首页