Web Authoring
  Home arrow Web Authoring arrow Building and Deploying an EAR
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB AUTHORING

Building and Deploying an EAR
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2007-07-05

    Table of Contents:
  • Building and Deploying an EAR
  • Application.xml
  • Common JAR
  • Exploring the New Directory Structure

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building and Deploying an EAR


    (Page 1 of 4 )

    An EAR file provides a convenient way to bundle up all pieces of a J2EE application. This article, the first of two parts, will show you how to build one and explain its various pieces. It is excerpted from chapter 3 of the book JBoss at Work: A Practical Guide, written by Tom Marrs and Scott Davis (O'Reilly; ISBN: 0596007345). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

    In the last chapter we introduced you to web applications, but the web tier is just one part of the J2EE spectrum. In this chapter, we’ll expand the JAW application from a simple WAR file into a full-fledged EAR.

    We’ll explore the different parts of an EAR file. We’ll build a Common JAR containing classes that can be shared across all tiers of the application. Finally, we’ll play with various Ant and XDoclet tasks to create our EAR and dynamically generate the deployment descriptors JBoss needs.

    WARs Versus EARs

    The WAR file is a convenient way to bundle up all pieces of a web application. All servlet containers know how to deploy a WAR file—they expand the bundle, look for the WEB-INF directory, and read the web.xml found there for further deployment instructions.

    The EAR file provides the same type of functionality for a full-fledged J2EE application. JBoss expands the EAR, finds the required deployment descriptors, and proceeds from there.

    An EAR is like a carton of eggs—it keeps everything organized. While the carton doesn’t add any direct value to your omelet, it makes getting the eggs home from the store so easy that you wouldn’t think about transporting eggs any other way.

    Each egg in your EAR carton is a specific piece of the J2EE puzzle. These eggs (or JARs) come in three basic varieties called “modules”:

    Web module
      
    A WAR file containing presentation tier components

    EJB module
      
    An EJB JAR file containing the middle-tier components
       (EJBs, MDBs, etc.)

    Java module
      
    A regular JAR file containing classes and libraries that
       are shared across the entire application. An
       application client JAR and a common JAR are two
       examples of Java modules.

    An EAR can contain at least one of any of these modules. By the same token, any of them can be safely omitted if they aren’t needed. Figure 3-1 shows the structure of an EAR file.


    Figure 3-1.  EAR file structure

    More Web Authoring Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "JBoss at Work: A Practical Guide,"...
     

    Buy this book now. This article is excerpted from chapter 3 of the book JBoss at Work: A Practical Guide, written by Tom Marrs and Scott Davis (O'Reilly; ISBN: 0596007345). Check it out today at your favorite bookstore. Buy this book now.

    WEB AUTHORING ARTICLES

    - Yahoo Pipes: Worth a Look
    - Completing an EAR
    - Building and Deploying an EAR
    - New Nuke Security Sentinel: Worth Taking a C...
    - Administering Your CMS-Based Web Site
    - What You Need to Know Before Using a CMS
    - Introducing the Google Maps API
    - An Overview of the Yahoo User Interface Libr...
    - Basic configuration of osCommerce, concluded
    - Basic configuration of osCommerce, continued
    - Basic configuration of osCommerce
    - Deploying your Site with PHPEclipse, continu...
    - Deploying your Site with phpEclipse
    - Macromedia Captivate Review
    - Macromedia and Adobe Planning to Tie the Knot







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek