Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

Tomcat 7 manager fails when uploading a WAR file larger than 50 MB.

When the Tomcat 7 manager tries to deploy a war file that is larger that 50 MB, it fails with the following exception:

Code Block
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (63475228) exceeds the configured maximum (52428800)
	org.apache.catalina.connector.Request.parseParts(Request.java:2780)
	org.apache.catalina.connector.Request.parseParameters(Request.java:3024)
	org.apache.catalina.connector.Request.getParameter(Request.java:1139)
	org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:382)
	org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:163)
	org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)


root cause 

org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (63475228) exceeds the configured maximum (52428800)
	org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:804)
	org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:284)
	org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:304)
	org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:129)
	org.apache.catalina.connector.Request.parseParts(Request.java:2718)
	org.apache.catalina.connector.Request.parseParameters(Request.java:3024)
	org.apache.catalina.connector.Request.getParameter(Request.java:1139)
	org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:382)
	org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:163)
	org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.25 logs.

ANSWER:

  • The session factory's mappingLocations element is used to configure the hibernate mappings.  Configuration instuctions can be found at: How to configure your application to use Hibernate Mappings .By default, the maximum file size that can be uploaded by the Tomcat 7 manager is 52428800 bytes. Do the following to change the default: