Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location
2017-11-13 17:44
1106 查看
spring-boot项目,生产环境运行一段时间后,上传图片报错,如下:
threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.2982178524163133296.8080/work/Tomcat/localhost/ssc] is not valid] with root cause] |
java.io.IOException: The temporary upload location [/tmp/tomcat.2982178524163133296.8080/work/Tomcat/localhost/ssc] is not valid
解决方案:添加指定目录
threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.2982178524163133296.8080/work/Tomcat/localhost/ssc] is not valid] with root cause] |
java.io.IOException: The temporary upload location [/tmp/tomcat.2982178524163133296.8080/work/Tomcat/localhost/ssc] is not valid
解决方案:添加指定目录
@Configuration public class MultipartConfig { /** * 文件上传临时路径 */ @Bean MultipartConfigElement multipartConfigElement() { MultipartConfigFactory factory = new MultipartConfigFactory(); factory.setLocation("/data/dubbo/cache"); return factory.createMultipartConfig(); } }
相关文章推荐
- nested exception is java.io.IOException: The temporary upload location
- nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/
- nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/jdbc.pro
- nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/
- spring boot 上传文件 Caused by: java.io.IOException: The temporary upload location [/tmp/tomcat.**/work/
- spring boot 上传文件出错:java.io.IOException: The temporary upload location
- fix errors 1088: “Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied” and 1334: “Exception: System.IO.FileLoadException”
- Failed to locate the winutils binary in the hadoop binary path java.io.IOException: Could not locat
- nested exception is java.io.FileNotFoundException: config.xml (系统找不到指定的文件。)
- SpringBoot项目的The temporary upload location ***is not valid 问题
- Java.Sql.Sqlexception: Io Exception: The Network Adapter Could Not Establish The Connection
- java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries
- java.io.IOException:Could not locate executable null\bin\winutils.exe in the Hadoop binaries
- 2016.11.10 Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver
- Could not instnested exception is java.lang.NoClassDefFoundError: org/aspectj/lang/annotation/Around
- 解决Could not open Hibernate Session for transaction; nested exception is java.lang.NoClassDefFoundEr
- Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: socket creation error
- Mariadb Could not get JDBC Connection; nested exception is java.sql.SQLException
- Exception in thread "main" java.io.IOException: This is not a DFS
- EncodingFilter Could not get JDBC Connection; nested exception is java.sql