[异常] Java文件上传异常org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of mul

前言:

             开发异常千变万化,总有那么一些看似困难,实则简单的异常,也是容易被忽视的小问题!往往不经意间就会使系统报错,导致无法正常运行!


错误日志:

FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. C:\Tomcat6.0\temp\upload__48b06dc6_150833d9b25__8000_00000002.tmp (系统找不到指定的路径。)

org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. C:\Tomcat6.0\temp\upload__48b06dc6_150833d9b25__8000_00000002.tmp (系统找不到指定的路径。)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:371)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:310)
    at efsframe.cn.action.IdentifyAction.UploadWord(IdentifyAction.java:471)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at efsframe.cn.action.MyActionServlet.process(MyActionServlet.java:13)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at efsframe.cn.action.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:21)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    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:191)
    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:293)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\Tomcat6.0\temp\upload__48b06dc6_150833d9b25__8000_00000002.tmp (系统找不到指定的路径。)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.(Unknown Source)
    at java.io.FileOutputStream.(Unknown Source)
    at org.apache.commons.io.output.DeferredFileOutputStream.thresholdReached(DeferredFileOutputStream.java:181)
    at org.apache.commons.io.output.ThresholdingOutputStream.checkThreshold(ThresholdingOutputStream.java:226)
    at org.apache.commons.io.output.ThresholdingOutputStream.write(ThresholdingOutputStream.java:130)
    at org.apache.commons.fileupload.util.Streams.copy(Streams.java:103)
    at org.apache.commons.fileupload.util.Streams.copy(Streams.java:66)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:366)
    ... 30 more


中文提示[系统找不到指定的路径C:\Tomcat6.0\temp]恍然大悟,然后看了一下本地Tomcat服务器文件目录,确实有Temp临时文件夹,然后再进入服务器查看Tomcat,问题就出现在Tomcat中的Temp文件夹消失导致文件上传失败!

解决方法:

       1. 自己新建一个temp目录;

       2. 在自己本地Tomcat中去复制temp目录,然后进行粘贴;

[异常] Java文件上传异常org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of mul_第1张图片


上传结果:

[异常] Java文件上传异常org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of mul_第2张图片

[异常] Java文件上传异常org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of mul_第3张图片



你可能感兴趣的:(Java)