Installing an Application Server and Deploying EJBs into It
The act of preparing and installing an EJB into a container is called deployment. In non-EJB systems, preparing and installing components into a runtime environment is a minor portion of the overall development process. Under the EJB regime, however, deployment assumes a much larger and more important role; the time and energy expended on deployment often exceeds the amount expended on actually coding the EJB.
Every application server vendor has its own way of deploying EJBs. They all share some common traits, however, that are illustrated in Figure 3.2 and described here:
An EJB's class (or sometimes its source code) files and its deployment descriptor are placed into an archive, which is typically a JAR file. Deployment descriptors are described in more depth in Part II, "Reference."
A deployment tool of some sort creates a deployable archive file (typically, but not always, a JAR) from the contents of the archive created in Step 1.
The deployable archive file is deployed into the EJB container by editing the container's configuration file or by running an administrative interface program.
Every application server vendor prescribes a process for deploying EJBs. The examples in this book are based on Sun's J2EE Reference Application Server, which is available free at http://www.javasoft.com. I chose it for two reasons: It is free, and it has a good deployment tool. I find deploying EJBs to the Reference Application Server much easier than deploying them anywhere else. The BookEaz EJBs will deploy into any EJB 2.0compliant server, so you can use any one you choose. The next few pages of this book are specific to the Reference Application Server, however, so you might find it easier to follow along if you "go with the flow" and use the same application server.
Appendix B supplies specific directions for installing and configuring the Reference Application Server and for getting a database connected to the application server. After installing the application server and configuring it per Appendix B's directions, you are ready to deploy your first EJB to it.