摘要:部署WAR文件过大Tomcat7报HTTP Status 500异常
本准备在Tomcat7.0\webapps下部署一个65Mb左右的war包,先后两次都以失败告终。第一次直接将war包上传到文件夹,让它自解压,然后手动安装,结果安装程序执行到70多个任务就卡住,最终只能停止Tomcat服务,当时不知原因。第二次用manager中的Deploy工具,结果出现如下错误:

message org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (66704562) exceeds the configured maximum (52428800)
在%安装目录%\webapps\manager\WEB-INF文件夹下用打开web.xml配置文件,可以看到支持文件大小的限制
<multipart-config>
<!-- 50MB max -->
<max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0</file-size-threshold> </multipart-config>
最大支持50MB上传!
将它改为100MB
<multipart-config>
<!-- 100MB max -->
<max-file-size>104857600</max-file-size>
<max-request-size>104857600</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
保存,重启Tomcat服务器。
@elva1087
Note:本文根据个人实际经历记录,引用请注明出处