Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceeded the limit for maxPostSize set on the associated connector

最近项目中用到了文件图片上传操作,

前端 使用把图片转成base64字节

后台使用String字符串进行接收(base64字节)

配置文件中进行文件上传大小配置

spring:
  http:
    multipart:
      max-file-size=20Mb //上传文件的大小限定;只有上传采用文件格式进行接收时起作用,针对上面的base64格式图片(后台是String进行接收)不起作用;
      max-request-size=60Mb //上传请求数据的大小限定;限定请求的总数据大小 运行后还是报错!! 又加了这两个配置 max-http-post-size: 102400000
max-http-header-size: 102400000

本地运行成功 本以为大功告成解决了 但是打包部署到服务器还是报一样的错误

根据提示 设置大小后依旧还是不生效,开发已经设置很大了,所以问题可能还是我这边的问题。

查询资料得知,tomcat7.0.63(包含)之后就不能用0表示,而是改为-1表示,我用的是8.0版本,故重新修改此值,问题解决。

修改tomcat文件 server.xml  增加 maxPostSize="-1"
<Connector port="8082" protocol="HTTP/1.1" URIEncoding="UTF-8"
connectionTimeout="20000"
redirectPort="8446"
maxPostSize="-1"
/>
 
QQ群:216868740

												

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的更多相关文章

  1. 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 ...

  2. SpringBoot整合Elasticsearch启动报错处理 nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit ...

  3. Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for this response

    问题分析: 在ServletRequest servletRequest中已经存在一个项目名称,此时,又用项目名称访问 http://localhost:8080/rent/pdf/preview r ...

  4. springboot 报错nested exception is java.lang.IllegalStateException: Failed to check the status of the service xxxService No provider available for the service

    spring: dubbo:#关闭所有服务的启动时检查:(没有提供者时报错) consumer: check: false timeout: 3000

  5. 解决spring mvc 上传报错,Field [] isn't an enum value,Failed to convert value of type 'java.lang.String[]' to required type '

    没有选择附件,但是点击上传按钮的时候会报错. 之前不选择文件,直接上传空文件是可以的,后来不知道改了什么就不行了. 错误信息: -- :: [http--] TRACE org.springframe ...

  6. Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill

    异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...

  7. springboot文件上传报错

    异常信息: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet reques ...

  8. 在系统下文件上传报错:The temporary upload location [/tmp/tomcat.xxx/work/Tomcat/localhost/ROOT] is not valid

    线上的系统中长时间不访问时不能上传文件了,出现如下错误: 2019-03-11 23:37:42.741 ERROR 66505 --- [nio-8081-exec-3] o.a.c.c.C.[.[ ...

  9. 两个由于php.ini配置错误导致的报错:ajax图片上传报错和exec报错

    遇到了两个由于php.ini配置错误导致的报错:ajax图片上传报错和exec报错 首先第一个: 在做一个用ajax图片上传的功能中,php报了这样一个错误:File upload error - u ...

随机推荐

  1. hdu 6046 hash

    题: OwO http://acm.hdu.edu.cn/showproblem.php?pid=6046 (2017 Multi-University Training Contest - Team ...

  2. 【leetcode】1276. Number of Burgers with No Waste of Ingredients

    题目如下: Given two integers tomatoSlices and cheeseSlices. The ingredients of different burgers are as ...

  3. FZU - 2218 Simple String Problem 状压dp

    FZU - 2218Simple String Problem 题目大意:给一个长度为n含有k个不同字母的串,从中挑选出两个连续的子串,要求两个子串中含有不同的字符,问这样的两个子串长度乘积最大是多少 ...

  4. Uva 10129 Play on Words(欧拉路)

    一些秘密的门包含一个非常有趣的单词拼图.考古学家们必须解决的问题 它打开那门.因为没有其他的方式来打开大门,这个谜是非常重要的 我们. 每扇门上都有大量的磁性板.每一个盘子上都有一个字 它.板块必须以 ...

  5. java中MD5函数

    import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class MD5U ...

  6. 关于lower_bound()和upper_bound()

    关于lower_bound()和upper_bound(): 参考:关于lower_bound( )和upper_bound( )的常见用法 注意:查找的数组必须要是排好序的.因为,它们查找的方式也是 ...

  7. 我的Linux vim配置文件

    map <F9> :call SaveInputData()<CR> func! SaveInputData() exec "tabnew" exec 'n ...

  8. LeetCode 109. 有序链表转换二叉搜索树(Convert Sorted List to Binary Search Tree)

    题目描述 给定一个单链表,其中的元素按升序排序,将其转换为高度平衡的二叉搜索树. 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1. 示例: 给定的有序链表: ...

  9. 石川es6课程---13-16、generator-认识生成器函数

    石川es6课程---13-16.generator-认识生成器函数 一.总结 一句话总结: ` generator函数,中间可以停,到哪停呢,用 yield 配合,交出执行权 ` 需要调用next() ...

  10. rocketmq的linux搭建环境

    3.3. 上传解压[两台机器] # 上传 apache-rocketmq.tar.gz 文件至/usr/local # tar -zxvf apache-rocketmq.tar.gz -C /usr ...