Web Authoring
  Home arrow Web Authoring arrow Page 2 - 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  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Completing an EAR - Deploying the EAR


    (Page 2 of 4 )

    Let’s make sure that the WAR files from the previous chapters don’t end up conflicting with our EAR file. Delete jaw.war from the deploy directory before moving on. Now we’re ready to drop in our newly created EAR file.

    Deploying an EAR by hand is no different than deploying a WAR by hand. Copy jaw.ear to $JBOSS_HOME/server/default/deploy. Your JBoss console should let you know that it was deployed successfully, as in Example 3-6.

    Example 3-6.  JBoss console output showing a successful EAR deployment

    22:37:55,659 INFO [EARDeployer] Init J2EE application:
          file:/Library/jboss-4.0.1/server/default/deploy/jaw.ear 22:37:55,853 INFO [TomcatDeployer] deploy, ctxPath=/jaw,
          warUrl=file:/Library/jboss-4.0.1/server/default/tmp/deploy/
          tmp25111jaw-ear.ear-contents/webapp.war/
    22:37:56,159 INFO [EARDeployer] Started J2EE application:
          file:/Library/jboss-4.0.1/server/default/deploy/jaw-ear.ear


    Automated Deployments Using Ant

    Ant allows you to do far more than simply compile and bundle up your Java application. It has tasks that let you create and delete directories and copy files to a local subdirectory or a remote server by using ftp or scp. Using tasks like exec, rexec, or sshexec, you can even remotely start and stop JBoss.

    It’s not hard to imagine completely automating the deployment process with an Ant script. But just because you can do something doesn’t always mean you should.

    Automating deployment to a test server certainly will help speed up your development iterations. But deployments to a production server should be taken a bit more seriously. Upgrading a production application is something that should be done deliberately, and in our opinion, should be done by hand.

    If you provide an Ant task to deploy your application to a production server, you almost certainly guarantee that you will invoke it accidentally at the most inopportune time.

    Since we point at a test server for this book, we’ve provided a convenient couple of Ant targets to deploy your EAR. To do a hot deploy, make sure that you have the $JBOSS_ HOME environment variable set, and then simply type ant deploy. The Ant task will copy the EAR file to the correct location for you.

    If you want to do a cold deploy, shut down JBoss, type Ant cleandeploy, and then start JBoss back up again. The cleandeploy target will delete the existing EAR file and several temporary directories. Running cleandeploy against a running JBoss instance will cause bad things to happen, so make sure that JBoss is not running before invoking it.


    Visit http://localhost:8080/jaw to confirm that the application was indeed deployed and still works as expected. Yes, this application doesn’t look or behave any differently than the one in the Web chapter. But we added hundreds of lines of new code—isn’t that the true measure of a successful J2EE project? (Only kidding….)

    In all seriousness, we haven’t added any new functionality that the user would notice, but we have set the stage for easy future growth and maximum flexibility. Knowing that the other tiers are coming up soon, these changes will allow you to incorporate the new technology with minimal effort.

    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-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway