user3477373
user3477373

Reputation: 365

Deploy large war file in tom cat web application manager

I have been trying to deploy my war file through tomcat web application manager but always end up with the uploadFileSizeExceeded Exception (Please see the picture below). Is there any way I can do to deploy large war file? I have tried to change the maximum file size, advised here but still facing the same problem.

Any suggestions?

Thanks in advance :) enter image description here

Upvotes: 1

Views: 2135

Answers (2)

Arjuna Bandara
Arjuna Bandara

Reputation: 41

I think easy way is using winscp or similar fttp client to transfer the war file and restart the server.

Upvotes: 3

Alien
Alien

Reputation: 15878

If you are deploying to Tomcat server version 7 and above, there is a configuration property called maxSwallowSize that you may have to set or change.

This property specifies the maximum number of bytes that Tomcat will “swallow” for an upload from the client when it knows the server will ignore the file.

The default value of the property is 2097152 (2 MB). If left unchanged or if set below the 5 MB limit that we set in our MultipartResolver, Tomcat will reject any attempt to upload a file over 2 MB, and our custom exception handling will never be invoked.

In order for the request to be successful and for the error message from the application to be displayed, you need to set maxSwallowSize property to a negative value. This instructs Tomcat to swallow all failed uploads regardless of file size.

Give a try with this in the TOMCAT_HOME/conf/server.xml file:

<Connector port="8080" protocol="HTTP/1.1"
  connectionTimeout="20000"
  redirectPort="8443"
  maxSwallowSize = "-1"/>

for more details refer http://www.baeldung.com/spring-maxuploadsizeexceeded

Upvotes: 1

Related Questions