Wednesday, April 24, 2013

Difference between ear, war and jar files.

Enterprise Application ( .ear )

An Enterprise Application consists of one or more of the following J2EE applications or modules:
  • Web applications
  • Enterprise Java Beans (EJB) modules
  • Resource Adapter modules
An Enterprise Application is packaged as an archive file with an .ear extension
you can say it's a collection of war & jar files

Web Application ( .war )
A Web application always includes the following files:
  • A servlet or JSP page, along with any helper classes.
  • web.xml deployment descriptor, a J2EE standard XML document that configures the contents of a WAR file.
Web applications may also contain JSP tag libraries, static .html and image files, supporting classes and .jar files, and a weblogic.xml deployment descriptor, which configures WebLogic Server-specific elements for Web applications. 

Enterprise JavaBean ( .jar )

Enterprise JavaBeans (EJBs) are reusable Java components that implement business logic and enable you to develop component-based distributed business applications. EJB modules are packaged as archive files having a .jar extension.


Summary



Deployment units that are packaged using the jar utility have a specific file extension depending on the type:
  • EJBs and client archives are packaged as .jar files.
  • Web applications are packaged as .war files.
  • Resource adapters are packaged as .rar files.
  • Enterprise applications are packaged as .ear files, and can contain other Java EE modules such as EJBs, JDBC, JMS, Web Applications, and Resource Adapters.
  • Web Services can be packaged either as .war files or as .jar files, depending on whether they are implemented using Java classes or EJBs. Typically, the .war or .jar files are then packaged in an Enterprise Application .ear file.
  • Java EE libraries are packaged either as an Enterprise Application (.ear file) or as a standard Java EE module.
  • Client applications and optional packages are packaged as .jar files.

3 comments:

saranya said...

I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
python Training institute in Pune
python Training institute in Chennai
python Training institute in Bangalore

priya said...

I'm here representing the visitors and readers of your own website say many thanks for many remarkable
Data Science training in chennai
Data Science training in OMR
Data Science training in chennai
Data Science Training in Chennai
Data Science training in Chennai
Data Science training in anna nagar

rohini said...

Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
Best Devops Training in pune
Devops Training in Bangalore
Microsoft azure training in Bangalore
Power bi training in Chennai