Java Reference
In-Depth Information
Chapter 13. Packaging EJB 3 applications
This chapter covers
• The Java EE module system
• Class loading in EE applications
• Packaging EJBs and MDBx
• Packaging JPA
• Packaging CDI
In the previous chapters you learned how to build a business logic tier with session and
message-driven beans, and you used entities to support the persistence tier. But now that you
have all this code, what do you do with it?
This chapter begins with a discussion of application packaging and deployment—the fun-
damentals needed to get your Enterprise application running. We'll explore how the various
modules (JAR, EJB-JAR, WAR, CDI, and EAR) of an EE application fit together and inter-
act when deployed to the EE server. We'll discuss how EE applications are configured both
through annotations and XML. Finally, we'll cover best practices and some common de-
ployment issues, especially when deploying the same application across different EE server
implementations. Let's start by looking at the EE modules and how they're packaged togeth-
er.
13.1. Packaging your applications
Your Enterprise Java application may contain hundreds of custom-developed Java classes.
The code you develop will be of different types, such as EJBs, Servlets, and JSF managed
beans, and persistence, helper, and utility classes. This code, in turn, will also be supported
by dozens of external libraries, resulting in hundreds more classes. All of these classes are
part of your application. In addition, applications will also typically contain non-Java code,
such as JSPs, HTML, CSS, JavaScript, and images. At some point, everything needs to come
together and be put on the EE server. This is known as deployment .
Recall from chapter 1 that the EJB container is part of the EE server and it's responsible for
managing EJBs and MDBs. An EJB-JAR module must be created for deployment to the EE
Search WWH ::




Custom Search