GeekInterview.com
Series: Subject: Topic:
Question: 269 of 360

what is difference between War file and Ear file?

Asked by: Interview Candidate | Asked on: Apr 19th, 2006
Showing Answers 1 - 8 of 8 Answers
rasik patel

Answered On : Apr 20th, 2006

War file is web application files only.ear file is complete j2ee application file that contain all (.jar,war,client)

  
Login to rate this answer.
meetnaveen4u

Answered On : Apr 25th, 2006

hi,War - This is Web Application archive which contains basic web application like servlet, jsp, html. This can be run on simple tomcat server.EAR - This is enterprise application which can have many War and EJB and other j2ee components into it and this can be run on weblogic , websphere.. and other server which supports enterprise application.ThanksNaveen.

  
Login to rate this answer.
Saurabh Raisinghaney

Answered On : May 3rd, 2006

An ear file consists of application.xml as its deployment descriptor and it consists of war jar and par files

  
Login to rate this answer.
srinivas

Answered On : May 22nd, 2006

hi       A J2EE application is packaged as a portable deployment unit called an     enterprise archive (EAR) file. An EAR file is standard JAR file with a .ear  extension. An EAR file contains:One or more J2EE modules A J2EE application deployment descriptorUnlike other deployment unit types, a WAR file usually cannot be loaded by a classloader, because its internal directory structure differs from that of a loadable JAR file. Like other module types, a WAR file may be deployed independently as a Web application or packaged in an EAR file and deployed as a J2EE application.ok bye..............keeps smiling and mailing bora_srinivasarao@yahoo.co.in

  
Login to rate this answer.

hi       A J2EE application is packaged as a portable deployment unit called an     enterprise archive (EAR) file. An EAR file is standard JAR file with a .ear  extension. An EAR file contains:One or more J2EE modules A J2EE application deployment descriptorUnlike other deployment unit types, a WAR file usually cannot be loaded by a classloader, because its internal directory structure differs from that of a loadable JAR file. Like other module types, a WAR file may be deployed independently as a Web application or packaged in an EAR file and deployed as a J2EE application.keeps smiling and mailingbora_srinivasarao@yahoo.co.in"HELP EVER HURT NEVER"&"IMPOSSIBLE AS POSSIBLE"Note:If any one want java materials like e-books,faq's send a mail to my id.if any doubts regarding java send a mail to my id, if possible i will send answers.if any one want how to install java softwares ,tomcat,weblogic,eclipse,jbuilder etc and how to use plz send amil or ask online also i will definitly tell.

  
Login to rate this answer.

hi       A J2EE application is packaged as a portable deployment unit called an     enterprise archive (EAR) file. An EAR file is standard JAR file with a .ear  extension. An EAR file contains:One or more J2EE modules A J2EE application deployment descriptorUnlike other deployment unit types, a WAR file usually cannot be loaded by a classloader, because its internal directory structure differs from that of a loadable JAR file. Like other module types, a WAR file may be deployed independently as a Web application or packaged in an EAR file and deployed as a J2EE application.keeps smiling and mailingbora_srinivasarao@yahoo.co.in"HELP EVER HURT NEVER"&"IMPOSSIBLE AS POSSIBLE"Note:If any one want java materials like e-books,faq's send a mail to my id.if any doubts regarding java send a mail to my id, if possible i will send answers.if any one want how to install java softwares ,tomcat,weblogic,eclipse,jbuilder etc and how to use plz send amil or ask online also i will definitly tell.clickon:http://in.geocities.com/bora_srinivasarao/MyHomepage.htmlFor java Click on it:http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/DEA2eIX.html

  
Login to rate this answer.
what is difference between War file and Ear file?

Answered On : Oct 12th, 2011

Jar files: These files are with the .jar extension. The .jar files contain the libraries, resources and accessories files like property files.

.war files: These files are with the .war extension. The war file contains the web application that can be deployed on the any servlet/jsp container. The .war file contains jsp, html, javascript and other files for necessary for the development of web applications.

.ear files: The .ear file contains the EJB modules of the applications.

  
Login to rate this answer.
patie

Answered On : May 22nd, 2012

View all questions by patie   View all answers by patie

JAR - Java ARchive

Its a file format based on the ZIP file format and similar to ZIP format this is also used for aggregating many files (many be of different types) into one aggregate file. This aggregate file will have (.jar) extension. Application development using Java uses JAR files for many useful purposes. One of the most common use is to package all the .class files, image files, and other files required by an Applet into a JAR file, so that the download of a single file will have all the components downloaded at the client machine.

This archive file format is platform-independent format which has been fully written in Java. This format is capable of handling audio and image files in addition to the .class files. Its an open standard and fully extendable. JAR file consist of a ZIP archive and an optional Manifest file, which contains package and extension related data. The Manifest file will have the name MANIFEST.MF. This manifest file belongs to the optional directtory named META-INF. This directory is used to store package and extension configuration data, security related data, versioning related data, services related data, etc.


WAR - Web ARchive

As the name suggests this file format is used to package all the components of a Web Application. It may contain JARs, JSPs, Servlets, HTMLs, GIFs, etc. The purpose of this archive format is same as that of the JAR - to make the deployment, shipping, and in turn the maintenance process easier. This will have an XML file named web.xml as the Deployment Descriptor. This Deployment Descriptor is used by the Web Container to deploy the web application correctly.


EAR - Enterprise ARchive

An enterprise application may be composed of several Web Applications and other independent JARs. This archive file format is used in those cases to bundle all the components of an enterprise application into a single file. Again the purpose is same - making deployment, shipping, and hence the maintenance easier. Since, an enterprise application may have several Web Applications as its components, hence an EAR file may contain WARs and JARs. An EAR also contains an XML-based Deployement Descriptor, which is used by the Application Server to deploy the enterprise application correctly.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Question Categories

Core Java Interview Questions

EJB Interview Questions

Hibernate Interview Questions

Java Interview Questions

Java Classes Questions

Java Patterns Interview Questions

Java Swing Interview Qustions

JDBC Interview Questions

JMS Interview Questions

JSP Interview Questions

Java OOPS Interview Questions

Ruby Interview Questions

Servlets Interview Questions

Spring Interview Questions

Struts Interview Questions

Websphere Interview Questions

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.