Tomcat's manager webapp provides a nice option to deploy WAR files through its GUI. I was trying to deploy Jenkins via the Tomcat 7's manager, and it threw this error.
At : http://localhost:8080/manager/html
HTTP Status 500 - org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (67841012) exceeds the configured maximum (52428800)
type Exception report
message org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (67841012) exceeds the configured maximum (52428800)
The Jenkins WAR file size is around 65MB only. A quick search showed that manager app by default allows only up to 50MB sized WAR files. This can be changed in the configuration file for manager web app.
My tomcat7 installation is the Ubuntu distribution provided one, hence the webapp is located at /usr/share/tomcat7-admin/manager/.
The configuration file is /usr/share/tomcat7-admin/manager/WEB-INF/web.xml.
In the file, look for the code snippet that says:
<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>
Modify the values max-file-size and max-request-size to a value of your choice. Since mine is a test environment and my WAR is just 65MB, I just appended a zero to the end of the values making the limit 500MB.
Restarted tomcat after that,
sudo service tomcat7 restart
Now the deployment is going through via manager app!
My Jenkins app is now deployed and available at http://localhost:8080/jenkins/