Packaging and app Deployment


In this chapter we'll look at packaging J2EE apps and deploying them onto app servers. This is an area in which we require server-specific knowledge, and in which portability between app servers is presently limited. As app servers use different approaches to class loading, we may need to package apps differently for different app servers. Even standard deployment units such as EARs may not be wholly portable. We'll also need to follow server-specific conventions to define resources such as JDBC DataSources, which apps require. As we'll see, the standard J2EE deployment descriptors do not provide all necessary information, meaning that we normally require additional, proprietary, deployment descriptors. Although the J2EE specifications describe the structure of standard deployment units, no standard deployment process is (as yet) mandated. As the details of app deployment differ between app servers, I'll aim to provide an introduction here, highlighting areas in which you'll need to research the behavior of your target server. After working through this chapter, you should have a feel for the commonality between app deployment on different servers, and the steps necessary to package and deploy a typical J2EE app on any server. We'll illustrate the concepts discussed by looking at what we need to do to get the sample app running in JBoss 3.0. Please check the download accompanying this tutorial for information on deploying the sample app to other servers.

Deployment options can have an important impact on performance, so it's vital to explore them throughout the app lifecycle, not merely get your app running on your chosen server.