java - How big a war file should be?

ID : 274350

viewed : 39

Tags : javatomcattomcat7wargrails-2.2java





Top 5 Answer for java - How big a war file should be?

vote vote

93

This is only a limit set for you to upload and deploy via the Tomcat 7 manager. There really is not a limit on the size of the war file you can deploy to a tomcat server.

Here is a link that can help you increase this upload size.

Quoted from link --

Go to the web.xml of the manager application (for instance it could be under /tomcat7/webapps/manager/WEB-INF/web.xml. Increase the max-file-size and max-request-size:

<!– 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> 
vote vote

85

If you're using Tomcat 8, the max-file-size is not in web.xml anymore. Instead, open conf/server.xml and find the tag entry for the HTTP connector. Then add the

maxPostSize="0" 

attribute and value to this tag. When you have completed editing the conf/server.xml file, save it and restart Apache Tomcat.

vote vote

73

The 50 MB default file size limit is not hard-coded, you can change it in the web.xml file of the Manager application of your webapp folder. You'll have to increase the max-file-size and max-request-size:

<!– 50MB max –> <max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0</file-size-threshold> 

Replace the current values with the appropriate values for your needs.

vote vote

67

Go to the web.xml of the manager application (for instance it could be under /tomcat7/webapps/manager/WEB-INF/web.xml.

Increase the max-file-size and max-request-size to for example 100Mb

vote vote

51

In tomcat7, update the tomcat7/server.xml. I installed tomcat7 in ubuntu so the directory is like below

ll /etc/tomcat7/ total 220 drwxr-xr-x   4 root root      4096 Oct  6 18:14 ./ drwxr-xr-x 136 root root     12288 Oct  6 16:12 ../ drwxrwxr-x   3 root tomcat7   4096 Sep 23 15:44 Catalina/ -rw-r--r--   1 root tomcat7   6506 Jun 27 12:48 catalina.properties -rw-r--r--   1 root tomcat7   1394 Jan 25  2014 context.xml -rw-r--r--   1 root tomcat7   2370 Feb 18  2016 logging.properties drwxr-xr-x   2 root tomcat7   4096 Sep 23 16:06 policy.d/ -rw-r--r--   1 root tomcat7   6716 Oct  6 18:14 server.xml -rw-r-----   1 root tomcat7   1607 Sep 23 15:50 tomcat-users.xml -rw-r--r--   1 root tomcat7 168099 Nov 25  2015 web.xml 

You would see the connector section in the conf file etc/tomcat7/server.xml,

<!-- A "Connector" represents an endpoint by which requests are received      and responses are returned. Documentation at :      Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)      Java AJP  Connector: /docs/config/ajp.html      APR (HTTP/AJP) Connector: /docs/apr.html      Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1"            connectionTimeout="20000"            URIEncoding="UTF-8"            redirectPort="8443"/> 

Stop the tomcat and just add the maxPostSize at the end,

sudo service tomcat7 stop 

Update the connector in the server.xml,

<!-- A "Connector" represents an endpoint by which requests are received      and responses are returned. Documentation at :      Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)      Java AJP  Connector: /docs/config/ajp.html      APR (HTTP/AJP) Connector: /docs/apr.html      Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1"            connectionTimeout="20000"            URIEncoding="UTF-8"            redirectPort="8443"             maxPostSize="57000000"/> 

Then restart the tomcat.

sudo service tomcat7 start 

Top 3 video Explaining java - How big a war file should be?







Related QUESTION?