Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How big a war file should be?

Tags:

Tomcat 7 manager limit the war file size to 50 Mo.

  • Why this limitation of 50 Mo ?
  • What should be the maximum war file size ? (in practice)

I'm working with Grails 2.2 which generate a minimal WAR of 28 Mo. So, the limit of 50 Min is very easy to reach.

like image 951
jvmvik Avatar asked Apr 09 '13 15:04

jvmvik


People also ask

What is the structure of a war file?

A war file is just a jar file (like a zip archive) with a standard structure. Basic structure: WEB-INF/ - directory for application support lib/ - supporting jar files web.

HOW WAR file is build?

To create war file, you need to use jar tool of JDK. You need to use -c switch of jar, to create the war file. Go inside the project directory of your project (outside the WEB-INF), then write the following command: jar -cvf projectname.

Why do we need a war file?

In software engineering, a WAR file (Web Application Resource or Web application ARchive) is a file used to distribute a collection of JAR-files, JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static web pages (HTML and related files) and other resources that together constitute a web ...


2 Answers

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>
like image 191
Kal Avatar answered Sep 21 '22 02:09

Kal


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.

like image 36
Ali Hashemi Avatar answered Sep 21 '22 02:09

Ali Hashemi