Tomcat 7作为HTTP文件服务器

时间:2017-07-03 06:18:35

标签: java tomcat

使用Tomcat 7作为HTTP文件服务器在高负载时(在多次请求突发之后)返回以下错误:

  

2017年7月2日下午1:42:42 org.glassfish.jersey.server.ServerRuntime $ Responder writeResponse   严重:将响应消息实体写入容器输出流时发生了I / O错误。   org.glassfish.jersey.server.internal.process.MappableException:org.apache.catalina.connector.ClientAbortException:java.io.IOException       at org.glassfish.jersey.server.internal.MappableExceptionWrapperInterceptor.aroundWriteTo(MappableExceptionWrapperInterceptor.java:92)       在org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162)       在org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130)       在org.glassfish.jersey.server.ServerRuntime $ Responder.writeResponse(ServerRuntime.java:711)       at org.glassfish.jersey.server.ServerRuntime $ Responder.processResponse(ServerRuntime.java:444)       在org.glassfish.jersey.server.ServerRuntime $ Responder.process(ServerRuntime.java:434)       在org.glassfish.jersey.server.ServerRuntime $ 2.run(ServerRuntime.java:329)       在org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:271)       在org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:267)       在org.glassfish.jersey.internal.Errors.process(Errors.java:315)       在org.glassfish.jersey.internal.Errors.process(Errors.java:297)       在org.glassfish.jersey.internal.Errors.process(Errors.java:267)       在org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)       在org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)       在org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)       在org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471)       在org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425)       在org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383)       在org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336)       在org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223)       在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)       在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)       在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)       在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)       在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)       在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)       在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)       在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)       在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)       在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)       在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)       在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)       在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)       at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:637)       在org.apache.tomcat.util.net.AprEndpoint $ SocketProcessor.doRun(AprEndpoint.java:2549)       在org.apache.tomcat.util.net.AprEndpoint $ SocketProcessor.run(AprEndpoint.java:2538)       在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)       at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)       at org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread.java:61)       在java.lang.Thread.run(Thread.java:748)   引起:org.apache.catalina.connector.ClientAbortException:java.io.IOException

避免此错误的最佳做法是什么?它从何而来?我曾尝试使用NIO模式,但仍然遇到此错误。

1 个答案:

答案 0 :(得分:1)

ClientAbortException似乎表示客户端已将其连接视为已发送。