Tomcat日志报错 More than the maximum number of request parameters (GET plus POST) for a single request

错误日志

org.apache.tomcat.util.http.Parameters.processParameters More than the maximum number of request parameters (GET plus POST) for a single request ([2,000]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector. 

解决方案

从中间件层面来解决的话,修改 Tomcat 的 maxParameterCount即可。

操作步骤

找到 server.xml

路径一般是:

$TOMCAT_HOME/conf/server.xml

修改 Connector 节点

找到类似下面这一段:

<Connector
    port="8080"
    protocol="org.apache.coyote.http11.Http11NioProtocol"
    connectionTimeout="20000"
    redirectPort="8443" />

修改为:

<Connector
    port="8080"
    protocol="org.apache.coyote.http11.Http11NioProtocol"
    connectionTimeout="20000"
    redirectPort="8443"
    maxParameterCount="5000" />

✅ 推荐值:3000~10000(根据实际需要)

重启 Tomcat

bin/shutdown.sh

bin/startup.sh

问题原因

这个错误是 Tomcat 对单个 HTTP 请求参数数量的保护限制,常见于 URL 参数过多 / 表单字段过多 / 前端序列化异常 的场景。

海拔科技

自媒体人,喜欢网络,热爱研究。本站头条号:星河 熊掌号:海拔科技

相关推荐

Win2008R2+java环境+tomcat安装

内容适用于个版本java环境和Tomcat,安装时请根据实际情况稍作修改即可。 准备软件: jdk-7u25-windows-x64.exe apache-tomcat-7.0.42-windows-x64.zip 一、安装java 1)安装jdk-7u25-windows-x64.exe,一路next …