`

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

分享到:
评论

相关推荐

    SpringBoot导入上传文件异常The temporary upload location is not valid

    错误spring boot上传文件错误The temporary upload location [/tmp/tomcat.******/work/Tomcat/localhost/ROOT] is not valid

    servlet3.0文件上传 01.zip

    1、在上传文件前请在计算机C盘新建一个名为“upload”的文件夹,否则会出现如下异常:java.io.IOException: The temporary upload location [C:\upload] is not valid 2、请不要使用360安全浏览器演示本功能,否则会...

    servlet3.0实现文件上传——demo1.zip

    1、在上传文件前请在计算机C盘新建一个名为“upload”的文件夹,否则会出现如下异常:java.io.IOException: The temporary upload location [C:\upload] is not valid 2、请不要使用360安全浏览器演示本功能,否则会...

    hive UDF需要jar包

    Hive UDF的实现通常涉及到编写Java代码,并将其打包成JAR(Java Archive)文件,然后在Hive会话中注册这个JAR,以便可以在SQL查询中调用自定义函数。以下是对标题和描述中涉及知识点的详细解释: 1. **Hive UDF**:...

    docker容器中 bash: vi: command not found,docker apt-get 异常 Temporary failure resolving

    bash: vi: command not found, 场景: 因为 docker里面没有这个命令,我们安装一下 apt-get update apt-get install vim 如果 这个时候 安装也还是会出现 异常 root@446d7cf1606c:/etc/mysql# apt-get update ...

    2009 达内Unix学习笔记

    集合了 所有的 Unix命令大全 ...telnet 192.168.0.23 自己帐号 sd08077-you0 ftp工具 192.168.0.202 tools-toolss ... 各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ ... 命令和参数之间必需用空格隔...

    SpringBoot 整合Mybatis 创建临时表

    @Insert("CREATE TEMPORARY TABLE IF NOT EXISTS temp_table (id INT PRIMARY KEY, name VARCHAR(255))") void createTempTable(); @Select("SELECT * FROM temp_table") List<TempTable> selectFromTempTable...

    upload.jar

    《Java Web服务器文件上传——基于sun java jdk 1.4.2_08的upload.jar解析》 在Java Web应用程序开发中,文件上传是一项常见的功能需求,它允许用户将本地文件发送到Web服务器进行存储或处理。在这个场景中,...

    Java_for_the_Web_with_Servlets

    - **How a Servlet Works**: When a request is sent to a servlet, the servlet container creates a new instance of the servlet if one does not already exist. The `init()` method initializes the servlet, ...

    VSS to SVN Tools

    The initial version of the VSS contents is downloaded to a temporary location and is imported to SVN. Subsequent VSS versions are repeatedly dowloaded to the temporary location and SVN is updated with...

    Commons-io-2.5.rar 相关jar包下载

    这个“Commons-io-2.5.rar”压缩包包含了Apache Commons IO库的2.5版本的jar包。Apache Commons IO库是Java开发者的重要工具,特别是在处理输入/输出操作时,它简化了许多常见的任务。 Apache Commons IO库中的主要...

    2012AlbumUp V0.57┊综合相册批量上传程序、支持网易163相册

    If all the pictures of both normal upload words is not generated log files. Directory operation: AlbumUp temporarily can't create new directory operations such as, The temporary 163_M ( 163 album ...

    Hitonic JAR Starter1.2.0汉化版(Jar启动器)

    The "Run JAR without JAD" feature is available (it will create a temporary JAD file). This powerful tool is very useful for Java developers and testers working with many various J2SE and J2ME ...

    IBM MQ错误码大全

    在使用 IBM MQ 过程中,可能会遇到各种错误码,这些错误码有助于开发者快速定位问题并进行解决。本文将详细介绍部分 IBM MQ 错误码的意义及应对策略。 #### 一、常见错误码详解 **1. 0: Noreasontoreport.** - **...

    Github-Copilot

    解决IDEA中Copilot登录不成功,GitHub Copilot: Failed to initiate the GitHub login process. Please try again,下载安装插件即可。

    Hitonic JAR Starter 1.2.0(Jar启动器).rar

    The "Run JAR without JAD" feature is available (it will create a temporary JAD file). This powerful tool is very useful for Java developers and testers working with many various J2SE and J2ME ...

    微软内部资料-SQL性能优化5

    The only source of any storage location information is the sysindexes table, which keeps track of the address of the root page for every index, and the first IAM page for the index or table....

    PMP考前培训笔记汇总

    the project is better understood How Temporary ? • Has a definite beginning and end and not an ongoing effort. • Ceases when objective has been attained. • Team is disbanded upon project completion...

Global site tag (gtag.js) - Google Analytics