5. Preparing the EJB JAR File

The final step in the EJB creation process is to package the Java class files and the Deployment Descriptor into a JAR file. The archive should have the following structure:

Example 1.5. AboutBean.jar

META-INF/ejb-jar.xml 1
nl/datraverse/workshop/ejb/beans/About.class
nl/datraverse/workshop/ejb/beans/AboutEJB.class
nl/datraverse/workshop/ejb/beans/AboutHome.class
1

The EJB specification requires that ejb-jar.xml is packaged under a directory called META-INF.

The JAR file is fed to an EJB container for deployment. In our case we will use the J2EE 1.3 Reference Implementation (RI) which is shipped with the J2EE SDK.