spring boot-The temporary upload location [ ] is not valid
生活随笔
收集整理的這篇文章主要介紹了
spring boot-The temporary upload location [ ] is not valid
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前言
- spring boot 2.0.0.RELEASE
- linux RH7
現象
19/09/10 17:17:02.185 ERROR 182 o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.5049141901586548468.8081/work/Tomcat/localhost/ROOT] is not valid] with root cause java.io.IOException: The temporary upload location [/tmp/tomcat.5049141901586548468.8081/work/Tomcat/localhost/ROOT] is not validat org.apache.catalina.connector.Request.parseParts(Request.java:2844)at org.apache.catalina.connector.Request.parseParameters(Request.java:3216)at org.apache.catalina.connector.Request.getParameter(Request.java:1137)at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:381)at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:75)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:748)原因
解決辦法1
重啟服務,臨時方案:會重新生成tomcat目錄,但是生產環境不建議如此操作
解決辦法2
指定tmpdir目錄。啟動時,使用 jvm 參數 -Djava.io.tmpdir=/home/weba。
解決辦法3(推薦方法)
指定tomcat的basedir目錄。在 application.properties 中配置server.tomcat.basedir=/home/weba。
參考
了解basedir目錄
Spring Boot Reference Guide(2.0.0.RELEASE)
總結
以上是生活随笔為你收集整理的spring boot-The temporary upload location [ ] is not valid的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Netflix、华纳兄弟与 Verizo
- 下一篇: 特斯拉被投行称为“非常昂贵的汽车公司”,