全局異常 The temporary upload location [/tmp/tomcat.1890695213050599631.9052/work/Tomcat/localhost/ROOT

早上導入報表出現錯誤,查看elk日誌。

1. elk ,filter.

fields.appname is prod-gate-error-log.

 

錯誤日誌:

2019-11-13 14:51:43.465 [gate: c0d670b5c5e6b6c3][http-nio-9052-exec-6] ERROR com.runlion.sat.tools.handler.ExceptionHandler - >>>>>>>>> 全局異常 The temporary upload location [/tmp/tomcat.1890695213050599631.9052/work/Tomcat/localhost/ROOT] is not valid >>>>>>>>>>>>>>
org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1890695213050599631.9052/work/Tomcat/localhost/ROOT] is not valid
	at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:112)
	at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:86)
	at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:79)
	at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1104)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:936)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)

2. 解決方案

@Configuration
public class FileConfig {

    @Bean
    MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setLocation("/app/excel");
        return factory.createMultipartConfig();
    }
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章