碰到一个怪异的问题

一个用Tapestry+Spring+Hibernate开发的系统,登录之后不做任何操作,过一段时间就会报内存溢出的错误!

用Eclipse,在布局类的里面设一个断点,发现总是有线程不停的跑到这个断点!!!

不知道是什么原因!谁知道可以告诉我!谢谢

Tapestry3.0中页面重复刷新或前一次提交没有完成进行第二次提交的时候会出现如下警告:
 
 

2006-12-14 14:12:31 org.apache.tapestry.engine.AbstractEngine
reportException

警告: Exception during post-request cleanup.

ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error

    at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:332)

    at org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:298)

    at org.apache.coyote.tomcat5.CoyoteOutputStream.flush(CoyoteOutputStream.java:85)

    at org.apache.tapestry.request.ResponseOutputStream.forceFlush(ResponseOutputStream.java:149)

    at org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:945)

    at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:198)

    at org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:159)

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

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

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

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

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

    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

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

    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

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

    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

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

    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

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

    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

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

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

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

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

 

 

**********************************************************

 

 

Exception during post-request cleanup.

 

 

      Session id: 94E8EF7AE0734BAFF77E89264964CFC3

  Client address: 127.0.0.1

 

Exceptions:

 

org.apache.catalina.connector.ClientAbortException

 

java.net.SocketException: Connection reset by peer: socket write error

java.net.SocketOutputStream.socketWrite0(Native Method)

java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

java.net.SocketOutputStream.write(SocketOutputStream.java:136)

org.apache.coyote.http11.InternalOutputBuffer.realWriteBytes(InternalOutputBuffer.java:714)

org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:398)

org.apache.coyote.http11.InternalOutputBuffer.flush(InternalOutputBuffer.java:304)

org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:921)

org.apache.coyote.Response.action(Response.java:182)

org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:327)

org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:298)

org.apache.coyote.tomcat5.CoyoteOutputStream.flush(CoyoteOutputStream.java:85)

org.apache.tapestry.request.ResponseOutputStream.forceFlush(ResponseOutputStream.java:149)

org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:945)

org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:198)

org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:159)

javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

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

java.lang.Thread.run( Thread.java:534 )
 
由于异常处理占用了部分内存,在大的访问量的时候会出现整个网站性能底下甚至会造成jvm的内存溢出。
解决办法:

Tapoestry 3 -> Tapestry 4 upgrade question
 

 I saw that error a lot in my existing 3.0 application. In my case I
eventually tracked it down to a low level socket write error (my server was
reporting that the browser shut the socket before it finished sending the
full stream). I'm sure there's another underlying cause e.g. the browser
didn't do that on a whim, but I couldn't figure out how to fix it.

I ended up having to superclass BaseEngine and turn the error
message into a noop just to keep my log from filling up with that particular
error message.

If you want to get rid of it, superclass BaseEngine, and override
reportError like this.

public void reportException(String reportTitle, Throwable ex) {
String name = ex.getClass().getCanonicalName(); //ex.getClass().getName();
if (name.endsWith("ClientAbortException")) {
Log.debug("Threw one of those annoying IE only flush
errors");
return;
}
super.reportException(reportTitle,ex);
}

你可能感兴趣的:(碰到一个怪异的问题)