6

我有一个 Spring 应用程序,用户可以在其中上传大文件(超过 300 mb)。在本地,它工作得非常好。但是,当我尝试在 Live 中使用我的应用程序时,大多数情况下它都会失败(但有时它会成功)。这是来自控制台的日志。任何人都可以帮助我如何摆脱错误。我正在使用 JQuery Chunk 文件上传功能。服务器是Tomcat 6。

17:02:28,395 DEBUG SessionFactoryUtils:793 - Closing Hibernate Session
File Path:/home/borneind/ty/uploads/7397758850/2190167412/1366559675908_06 - Mergel - Mergedelica.wav
17:02:31,036 DEBUG ExceptionHandlerExceptionResolver:132 - Resolving exception from handler [public void com.jmacksoft.common.controller.TranceController.getDocumentFileContent(javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException]: ClientAbortException:  java.io.IOException
17:02:31,037 DEBUG ResponseStatusExceptionResolver:132 - Resolving exception from handler [public void com.jmacksoft.common.controller.TranceController.getDocumentFileContent(javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException]: ClientAbortException:  java.io.IOException
17:02:31,037 DEBUG DefaultHandlerExceptionResolver:132 - Resolving exception from handler [public void com.jmacksoft.common.controller.TranceController.getDocumentFileContent(javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.String,java.lang.String,java.lang.String) throws java.io.IOException]: ClientAbortException:  java.io.IOException
17:02:31,038 DEBUG DispatcherServlet:910 - Could not complete request
ClientAbortException:  java.io.IOException
    at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
    at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
    at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)
    at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
    at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
    at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
    at org.springframework.util.FileCopyUtils.copy(FileCopyUtils.java:113)
    at com.jmacksoft.common.controller.TranceController.getDocumentFileContent(TranceController.java:603)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException
    at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:692)
    at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:722)
    at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:118)
    at org.apache.coyote.http11.InternalAprOutputBuffer.doWrite(InternalAprOutputBuffer.java:528)
    at org.apache.coyote.Response.doWrite(Response.java:560)
4

1 回答 1

2

根据页面已被浏览超过 2000 次的事实唤醒僵尸。
我敢肯定,原始海报为时已晚,但对于未来的读者来说,这是您的解决方案。

如果您使用的是 jquery,则需要为完成异步请求设置更长的超时值。此博客条目提供了一种执行此操作的方法。在您的情况下,您没有登录,但该示例应该为您提供所需的内容。引用帖子...

function SuccessFunction(data, status) {

          var obj = jQuery.parseJSON(data.d);
          if (obj.Success == “true”) {
              writeConsole(‘logging in’);
              $.ajax({
                  type: “GET”,
                  url: ‘<% Response.Write(url); %>?’ + obj.UserNameAndPassword,
                  dataType: ‘jsonp’,
                  complete: function() {
                      $.mobile.changePage(“#success”, { transition: “fade” });
                  },
                  timeout: 5000 // sets timeout to 5 seconds
              });
          }
          else {
              $(“#popupFail”).popup(“open”, { transition: “fade” });
              writeConsole(‘login failure ‘);
          }
          return;
      }

...我建议找到一种方法来集中该值,而不是在整个脚本中随意散布它。注意不要在受限环境中选择太短的超时。您的开发体验几乎总是比在野外的体验更好。

于 2015-02-09T18:55:42.227 回答