Less than 42 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

diff between jar, ear and war files in detail  RSS feed

 
nallagangu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Can some one explain the diff between application level(ear) web archive(war) and java archive(jar) files in detail..
thanks in Advance...
Nallagangu
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's really not all that complicated. JAR EAR and WAR file are first and foremost, all ZIP files. They thus contain other files. There's a nesting structure here:

EAR (Application Archive)
EAR Contains 0..N WAR (Web Archives)
WAR Contains 0..N Servlet (.class) files
WAR Contains 0..N JSP files
WAR Contains 0..N other utility files (.jars and .class files)
EAR Contains 0..N EJB JAR files
EJB JAR Contains 1..N EJB's (each EJB has at least 3 .class files)
Every file type (EAR, JAR and WAR) has a special "deployment descriptor" that is an XML file describing its contents to the application server. for the EAR this is the application.xml file. For the WAR it's web.xml. For the EJB JAR it's EJB-JAR.XML.
For more information (and a set of cool diagrams) see Richard Monson-Haefel's 3rd Edition EJB book, and my WebSphere workbook (http://www.oreilly.com/catalog/entjbeans3/workbooks/index.html) for this book. (You can download the workbook).
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
[This message has been edited by Kyle Brown (edited October 25, 2001).]
[This message has been edited by Kyle Brown (edited October 25, 2001).]
 
deep venu
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
A JAR file can be a group of java classes. In J2EE context it would have all the classes of beans, DAO, Data objects, static classes etc.
Your WAR (Web Archive) would contain all thw web components like htmls, images, jsps, servlets,CSS files etc..
An EAR ( Enterpise Archive ) file usually contains JAR and WAR files and in gets deployed as an application in your app server.
:-)
Dee
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!