java.lang.IllegalArgumentException: Request header is too large

简介: tomcat运行项目时,有一个请求过去后,后台报这样的错java.lang.IllegalArgumentException: Request header is too large原因:请求头超过了tomcat的限值。

tomcat运行项目时,有一个请求过去后,后台报这样的错java.lang.IllegalArgumentException: Request header is too large
原因:请求头超过了tomcat的限值。本来post请求是没有参数大小限制,但是服务器有自己的默认大小。
解决:
处理办法:在server.xml中

<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"  maxPostSize="0" maxHttpHeaderSize ="102400"/> 

处加上maxHttpHeaderSize ="102400"

Spring Boot中需要的配置:
application.properties:

server.tomcat.max-http-post-size=2147483647

 






 

相关文章
|
2月前
|
数据库
java.sql.SQLException: txn too large, size: 104857606.
该博客文章讨论了在TiDB数据库中遇到的"txn too large"错误,原因是事务大小超过了默认限制,解决方案是减少每次删除操作的数据量以降低事务的总大小。
57 0
|
3月前
|
消息中间件 Java Maven
java.util.zip.ZipException: invalid LOC header (bad signature)
java.util.zip.ZipException: invalid LOC header (bad signature)
45 1
|
5月前
|
Java 应用服务中间件 Spring
SpringBoot出现 java.lang.IllegalArgumentException: Request header is too large 解决方法
SpringBoot出现 java.lang.IllegalArgumentException: Request header is too large 解决方法
208 0
|
5月前
|
Java 微服务
Java错误:微服务报错Cannot execute request on any known serve
Java错误:微服务报错Cannot execute request on any known serve
|
5月前
|
前端开发 Java 应用服务中间件
【异常解决】java程序连接MinIO报错The request signature we calculated does not match the signature you provided.
【异常解决】java程序连接MinIO报错The request signature we calculated does not match the signature you provided.
358 0
|
5月前
|
存储 前端开发 Java
JavaWeb:Request & Response
在JavaWeb开发中,Request(请求)和Response(响应)是非常重要的概念。它们分别代表着客户端向服务器发送请求和服务器向客户端返回响应的过程。Request对象是由服务器创建的,用于封装来自客户端的请求信息。它包含了请求的HTTP方法(如GET或POST),URL,请求头部、参数等信息。你可以通过Request对象获取客户端发送的表单数据、URL参数、HTTP头部和Cookies等。Response对象则是服务器用来向客户端发送响应的工具。它包含了HTTP状态码、响应头部和响应体等信息。你可以使用Response对象设置响应的状态码、设置响应头部
64 3
 JavaWeb:Request & Response
|
5月前
|
Java 应用服务中间件
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallablePro
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/context/request/async/CallablePro 错误处理
80 0
|
5月前
|
Oracle 安全 Java
[Java] `JDK17` 模式变量 `Pattern variable` Variable ‘request‘ can be replaced with pattern variable
[Java] `JDK17` 模式变量 `Pattern variable` Variable ‘request‘ can be replaced with pattern variable
|
5月前
|
Java
【Java报错】MultipartFile 类型文件上传 Current request is not a multipart request 问题处理(postman添加MultipartFile)
【Java报错】MultipartFile 类型文件上传 Current request is not a multipart request 问题处理(postman添加MultipartFile)
483 0
|
12月前
|
存储 API
10JavaWeb基础 - Request类
10JavaWeb基础 - Request类
50 0
下一篇
无影云桌面