Home

 

EJB 3.0 application packaging

Session beans and MDBs can be packaged in a Java standard JAR file. This can be achieved by two strategies:

Using a Java project or Java Utility project

Using an EJB project

If you use the first approach, you have to add the Java Project to the EAR project, by editing the deployment descriptor (application.xml), and adding the lines:

<module>
	<ejb>MyEJB3Module.jar</ejb>
</module>

When using the second approach, the IDE can automatically update the application.xml file, and set up an ejb-jar.xml inside the EJB project. However, in EJB 3.0, you are not required to define the EJBs and related resources in an ejb-jar.xml file, because they are usually defined through the use of annotations. The main usage of deployment descriptor files is to override or complete behavior specified by annotations.

ibm.com/redbooks