尝试使用AjaxUpload导入excel文件时,使用小文件可以执行导入。有一个稍大的excel文件,包含接近2MB的数据,我得到以下错误。
这是我在jsp中的ajaxUpload():
$.ajaxFileUpload(
{
url:'pi/importPI.do?custNamefrmList='+custNamefrmList+'&neNamefrmList='+neNamefrmList+'&bIndex='+bIndex+'+&fullPath='+fullPath+'',
type:"post",
secureuri:false,
fileElementId:'uploadfile',
method:'POST',
//dataType: 'json',
dataType: 'json',
cache:false,
async:false,
success: function (data)
{
}
2013年4月5日下午12:14:51 org.apache.catalina.core.StandardWrapperValve调用
严重:Servlet [dispatcher]的Servlet.service()在路径[/ PMDB]的上下文中引发异常[请求处理失败;嵌套异常是org.springframework.web.multipart.MultipartException:无法解析多部分servlet请求;嵌套异常是org.apache.commons.fileupload.FileUploadBase $ IOFileUploadException:处理multipart / form-data请求失败。连接重置]有根本原因
java.net.SocketException:连接重置
在java.net.SocketInputStream.read(SocketInputStream.java:168)
在org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:532)
在org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:501)
at org.apache.coyote.http11.InternalInputBuffer $ InputStreamInputBuffer.doRead(InternalInputBuffer.java:563)
在org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:118)
at org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer.java:341)
在org.apache.coyote.Request.doRead(Request.java:422)
在org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:290)
在org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:431)
在org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:315)
在org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:200)
at org.apache.commons.fileupload.MultipartStream $ ItemInputStream.makeAvailable(MultipartStream.java:976)
at org.apache.commons.fileupload.MultipartStream $ ItemInputStream.read(MultipartStream.java:886)
在java.io.InputStream.read(InputStream.java:85)
在org.apache.commons.fileupload.util.Streams.copy(Streams.java:96)
在org.apache.commons.fileupload.util.Streams.copy(Streams.java:66)
在org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366)
在org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
在org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:155)
在org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:138)
在org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:904)
在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:747)
在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
在org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
在javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at or or or or or or or or or or or or or or or or or
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:565)
在org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)
在java.lang.Thread.run(Thread.java:662)
答案 0 :(得分:1)
我认为这只是阻止上传的默认Tomcat POST大小限制> 2 MB。
点击此处查看解决方案:
http://vicker313.wordpress.com/2010/08/12/increase-or-make-unlimited-maximum-post-size-in-tomcat/