zoukankan      html  css  js  c++  java
  • SpringBoot打成jar包部署,遇到:The temporary upload location is not valid问题

    springboot开发,部署服务器,遇到以下报错:

    org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException:   
    The temporary upload location [/tmp/tomcat.2090842327674075737.8081/work/Tomcat/localhost/ROOT] is not valid  
        at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.handleParseFailure(StandardMultipartHttpServletRequest.java:120) ~  
        [spring-web-5.0.4.RELEASE.jar!/:5.0.4.RELEASE]  
    

      

    解决:

    在application.yml或application.properties中添加如下配置:

    server:

      port: 5555

      servlet:

          context-path: /xxxx

     #这段配置

      tomcat:

          remote-ip-header: x-forward-for

          uri-encoding: UTF-8

          max-threads: 1000

          max-http-header-size: 8096

          #核心代码,设置tomcat的basedir

          basedir: ${user.home}/tomcat/tmp

    关于basedir,源码是这么解释的,Tomcat base directory. If not specified, a temporary directory is used.,也就是tomcat基础目录,如果没有指定,就用临时目录

    加上这段tomcat的配置,到目前为止,在未出现这个错误。

    方法来源:https://blog.csdn.net/moshowgame/article/details/82622546

  • 相关阅读:
    服务器模型??
    tcp和udp详解??
    osi七层模型??
    高内聚 低耦合??
    进程和线程的区别和联系??
    2019.10.03题解
    2019.10.02题解
    2019.09.29考试报告
    2019.09.27考试报告
    2019.09.26考试报告
  • 原文地址:https://www.cnblogs.com/DreamFather/p/11327502.html
Copyright © 2011-2022 走看看