Web Authoring
  Home arrow Web Authoring arrow Completing 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

Completing an EAR
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2007-07-10

    Table of Contents:
  • Completing an EAR
  • Deploying the EAR
  • Adding a DAO
  • Using XDoclet

  • 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


    Completing an EAR


    (Page 1 of 4 )

    In the second of two parts, we focus on deploying the EAR we built in the previous article. This article is excerpted from chapter three 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.

    Ant EAR task

    The final step in the process is to EAR up the results of the webapp and common builds. Just as there is a WAR task, Ant also provides us with an EAR task, as in Example 3-4.

    Example 3-4.  master build.xml

    <target name="ear" depends="compile">
            <ear destFile="${distribution.dir}/${ear.name}"
                 appxml="${meta-inf.dir}/application.xml" >

                <!-- files to be included in
    / -->
                <fileset dir="${webapp.war.dir}" />
               
    <fileset dir="${common.jar.dir}" />
            </ear>
        </target>

    Notice that the EAR task requires us to pass it a well-formed application.xml file. Example 3-5 shows what a simple one looks like.

    Example 3-5.  application.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns=http://java.sun.com/xml/ns/j2ee 
               xmlns:xsi=http://www.w3.org/ 2001/XMLSchema-instance 
               xsi:schemaLocation="http:// java.sun.com/xml/ns/j2ee
                   http://java.sun.com/
    xml/ns/j2ee/application_1_4.xsd"
               version="1.4">
      <display-name>JBossAtWorkEAR</display-name>

      <module>
         
    <web>
             <web-uri>webapp.war</web-uri>
             <context-root>jaw</context-root>
          </web>
      </module>

      <module>
          <java>common.jar</java>
      </module>

    </application>

    To verify the results of themasterbuild, change to the build/distribution directory and typejar tvf jaw.ear. You should see webapp.war, common.jar, and application.xml. We are now ready to deploy the EAR file.

    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 three 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 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek