19.4. Building, Deploying, and Running the Examples

Coding an EJB is only half the fun. Deploying it introduces several new concepts and complexities. We've already used JAR and WAR files; for EJBs, we introduce two new variations on the theme. An EJB-JAR file is a JAR file that contains one or more Enterprise JavaBeans. An EAR (Enterprise ARchive) file is a file that can contain multiple components, which are themselves archive files—so, an EAR might contain several EJB-JARs, plus a WAR file that contains the user interface (servlet and JSP) components of the application.

We'll begin by packaging our bean in an EJB-JAR file. Each EJB-JAR file requires a deployment descriptor. The deployment descriptor for an EJB-JAR file is named ejb-jar.xml ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.