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

解决方案:添加指定目录

@Configuration
public class MultipartConfig {
/**
* 文件上传临时路径
*/
@Bean
MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setLocation("/data/dubbo/cache");
return factory.createMultipartConfig();
} }

Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location的更多相关文章

  1. org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1428942566812653608

    一.异常信息 org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet reque ...

  2. SpringBoot 上传文件突然报错 Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1428942566812653608

    异常信息 org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request ...

  3. Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1428942566812653608

    这个问题也是某天做一个上传文件功能发生的.然后在网上查找的资料,整理了这几个解决方案. 1.在application.yml文件中设置multipart location ,并重启项目 spring: ...

  4. Springboot 上传报错: Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceede

    Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The ...

  5. Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed.

    org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nes ...

  6. 出错: IOException parsing XML document from ServletContext resource [/cn.mgy.conig]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/cn.mgy.conig]

    错误的详细内容: 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanDefinitionStoreExceptio ...

  7. nested exception is java.io.FileNotFoundException: class path resource [spring/spring-datasource-mog

    spring单元測试时发现的问题: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsin ...

  8. parsing XML document from class path resource [config/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [config/applicationContext.xml] 解决方案

    parsing XML document from class path resource [config/applicationContext.xml]; nested exception is j ...

  9. org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: c

    //这个是 配置文件放错了地方 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing ...

随机推荐

  1. 17_常用API_第17天(包装类、System、Math、Arrays、大数据运算)_讲义

    今日内容介绍 1.基本类型包装类 2.System类 3.Math类 4.Arrays类 5.大数据运算 01基本数据类型对象包装类概述 *A:基本数据类型对象包装类概述 *a.基本类型包装类的产生 ...

  2. angularJS中$apply()方法详解

    这篇文章主要介绍了angularJS中$apply()方法详解,需要的朋友可以参考下   对于一个在前端属于纯新手的我来说,Javascript都还是一知半解,要想直接上手angular JS,遇到的 ...

  3. .Net用字符串拼接实现表格数据相同时合并单元格

    前言 最近在做项目通过GridView或Repeater绑定数据,如果两行或若干行某列值相同,需要进行合并单元格,但是实现过程中想到了字符串拼接,于是就没用绑定数据控件,而是用了html结合字符串实现 ...

  4. 微信小程序wx:for和wx:for-item的正确用法

    wx:for="{{list}}"用来循环数组,而list即为数组名wx:for-item="items" 即用来定义一个循环过程中每个元素的变量的 如果是一维 ...

  5. maven下载、安装、卸载以及MyEclipse配置maven

    maven下载 官网下载:http://maven.apache.org/download.cgi 点击链接为官网下载页面,翻到下图所示位置,点击红框选项即可下载 maven安装 1.解压       ...

  6. Windows安装ElastAlert问题总结

    1.运行时出现UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb4 in position 0: invalid start byte 或  ...

  7. BZOJ4870 [Shoi2017]组合数问题 【组合数 + 矩乘】

    题目链接 BZOJ4870 题解 \[ans = \sum\limits_{i = 0}^{\infty}{nk \choose ik + r} \pmod p\] 发现实际是求 \[ans = \s ...

  8. Java的内存结构

    Java中的内存结构 运行时数据区域的划分: 程序计数器(PC寄存器) 程序计数器(Program Counter Register)是一块较小的内存空间,可以看做是当前线程所执行的字节码的行号指示器 ...

  9. 基于excel导入数据到ms sql server

    OLE DB (Object Linking and Embedding, Database, sometimes written as OLEDB or OLE-DB) an API designe ...

  10. 【Asp.net入门02】搭建Asp.net开发环境

    本节主要讲解: 什么是asp.net asp.net开发和运行环境介绍 1.什么是ASP.NET Asp.net不是一种编程语言,而是一种开发技术.我们可以利用这种技术所提供的类库,使用C#或者VB编 ...