tomcat9上传文件失败错误
项目上线正常运行一段时间后,有一天突然所有的附件上传都出现了错误,查找项目本身的日志系统也一致没有跟踪到错误。经过几番折腾,在tomcat9-stdout.log日志中发现如下异常:
ERROR org.springframework.boot.web.servlet.support.ErrorPageFilter 190 forwardToErrorPage - Forwarding to error page from request [/upload/dbupload] due to exception [Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. E:\Tomcat9\work\Catalina\localhost\ROOT\upload_6aee88fc_f7bb_4c8d_b663_51fad2d80eee_00000000.tmp (文件或目录损坏且无法读取。)] org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. E:\Tomcat9\work\Catalina\localhost\ROOT\upload_6aee88fc_f7bb_4c8d_b663_51fad2d80eee_00000000.tmp (文件或目录损坏且无法读取。)
因此,可能是无法访问tomcat工作目录work所致。
因此将此work目录重命名为_work,并重启服务器后,重建工作目录work,恢复正常。
出处:http://www.cnblogs.com/isaboy/
声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。