Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > Managing WebSphere objects: The facts about EARs and WARs
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

Managing WebSphere objects: The facts about EARs and WARs


Bob Cancilla
10.03.2002
Rating: -4.50- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Since IBM began shipping the 4.0 version of WebSphere Advanced Edition, the server and documentation imply that you must package up all of your objects and stick them in either an Enterprise Archive (EAR) or Web Archive (WAR). IBM's WebSphere Studio Development Tools are built around the WAR and the EAR. When you create a project in any of the WSxx or WDSC tools, two major components are created: a directory path for your source objects, and a directory that will contain your EAR file.

Using this approach, a WAR file is created for Web-based objects, including your JSPs, HTML pages, images, etc. At deployment time those objects are gathered up and bundled into the WAR file. Any Java objects such as your model objects, EJBs, etc. are bundled up and stuck in the EAR as is your WAR file. The bottom line when all is done is that you end up with an EAR file containing a WAR file, JAR files (possibly), and discrete classes. Included in the EAR and the WAR are the subdirectories that were created as you developed your application.

You are then supposed to publish your EAR file to a directory on your target machine then via the WebSphere console install the application bundled in the EAR.

WebSphere then unpacks the EAR file, creating all of the subdirectories that you created on your PC. When it encounters the WAR file it also unpacks it, creating all of its subdirectories.

Doesn't it kind of look like the EAR and the WAR are nothing but suitcases that you stuff your application objects in to send to the server where they are unpacked? That is exactly what happens. Major hardware and software companies such as IBM, Sun Microsystems, Hewlett-Packard operate the J2EE consortium. Their bias is that of a software company selling application software. For a vendor to ship a single EAR file that a user installs and the server unpacks eliminates a lot of installation support issues and hassles.

Unfortunately, for the commercial developer this introduces management issues that make the in-house development and deployment of Java applications a nightmare. I don't know about you, but my users want us to make small cosmetic changes that may affect a single JSP. How many times do you change one word in the JSP?

Lets first look at exactly what EAR, WAR, and JAR files are. They are nothing more than ZIP files using the file format and compression schemes dictated by PKzip. You can unpack an EAR file using WINZIP32 or any other PKzip utility. A WAR file contains a file called web.xml that allows you to control the behavior of specific resources within the application server. This includes creating object alias's, instructing the server to load the object on server startup and other features. It is NOT required to run your applications. The EAR file contains two XML files: the Deployment Descriptor File and the Application Descriptor file. Those get involved with EJB development.

My apologies to IBM's WebSphere server developers, but the WebSphere Application Server is nothing but a bunch of Java classes and APIs (mandated by the Servlet, JSP, and EJB specification) that sit inside an OS/400 JOB (NT or Unix Process) and run in the JOB in a JVM that is loaded into the Job at startup.

While IBM encourages you to stick your objects in your EAR and let WebSphere unpack them in to an IBM controlled directory, the reality is your programs run in WebSphere's JVM. You may modify the WebSphere classpath for your server and put objects anywhere on the machine.

To create an application you must deploy an EAR or a WAR, but this can contain a single dummy class. You may then manually control the classpath and put objects anywhere you wish.

My developers have come up with a strategy of putting application-specific objects in an EAR file and deploying the EAR, but carefully separating "shared" objects (those objects used in many applications) and placing them in a directory tree that we called "Shared".

We also use our change control system to manage individual objects after we first deploy our EAR so that a developer may check out change and check in a single Java object.

I'm limited on space in this tip, but I will write more on this issue in future tips.

-------------------------
About the author: Bob Cancilla is managing director of IGNITe/400, an electronic iSeries 400 Internet users group. He is also author of the book Getting Down to e-business with AS/400 and IBM eServer iSeries: Built for e-business.

=======================
MORE INFORMATION
=======================

  • Eliminate WebSphere team deployment headache
    IBM made some significant enhancements to the Administrative Console with the introduction of V4.01 Advanced Edition. Unfortunately, the product's origins on the NT platform present challenges to multiuser machines like the iSeries that were not anticipated or handled well by the cross-platform development team, says e-business expert Bob Cancilla.
  • Introduction to QShell: Administer Java applications
    IBM has provided more than one way to do most of the administrative tasks you need for Java applications. Some of them can just help manage files; others do much more.
  • WebSphere/Web development discussion forum:
    Post your WebSphere and Web development questions here. You'll get advice from our site experts who monitor the forum, as well as ideas and suggestions from other users.
  • Best Web Links on Web Development


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Web Tools
Putting data from IBM i on Amazon S3 using i2S3
TAATOOL: Useful tools for programmers on IBM i
Programming for the Web on the IBM i, what is possible
Zend Web software teams up with IBM System i
Using geocoding on AS/400 to enhance your Web presence
The iSeries Blog has a new home on IT Knowledge Exchange
The best technologies and tools for System i programmers in 2009
Search400.com Products of the Year 2008
Application modernization strategies for System i
Natively supported Web applications for Power running i

Web Development
Implementing a browser interface in COBOL: Creating your graphic Web page
Implementing a browser interface in COBOL: Getting started
IBM i shop boosts online sales with RPG-based Web platform
Migrating from RPG to EGL on IBM i
Groovy programming on IBM i
Running PHP open source applications: NOBODY needs authority
Zend Web software teams up with IBM System i
The best technologies and tools for System i programmers in 2009
Seven IBM i project lessons learned in 2008
AS/400 lessons from the past, present, and future: A holiday tale

Application Development
iSeries calling an .exe
Top 10 programmer tips
Formatted work job scheduler
Convert system date and time
Mixing free format code with embedded SQL
SQL update a field in one file from a field in another file
Webcasts for iSeries programmers
Programming advice from the pros
Easy code copying via the drag and drop method
Setting FTP time-outs

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts