Assemble EJB modules
An EJB module is used to assemble one or more enterprise beans into a single deployable unit. An EJB module is stored in a standard Java archive (JAR) file.
An EJB module contains:
- One or more deployable enterprise beans.
- A deployment descriptor, stored in an Extensible Markup Language (XML) file. This file declares the contents of the module, defines the structure and external dependencies of the beans in the module, and describes how the beans are to be used at run time.
An EJB module can be used as a standalone application, or it can be combined with other EJB modules, or with Web modules, to create a J2EE application. An EJB module is installed and run in an enterprise bean container.
Assemble an Enterprise JavaBeans (EJB) module to contain enterprise beans and related code artifacts. Group Web components, client code, and resource adapter code in separate modules.
An EJB module can be installed as a standalone application or can be combined with other modules into an enterprise application.
The Application Assembly Tool (AAT), which runs on your workstation, provides flexibility in assembling EJB modules. Options described below include:
- Importing an existing EJB module (EJB JAR file)
- Create a new EJB module
- Copying code artifacts (such as entity beans) from one EJB module into a new EJB module
- Start the AAT.
- Select File-->New-->EJB Module. The navigation tree displays various sets of properties for configuring the new EJB module.
- (Optional) Use the property dialog shown in the AAT workspace to change the default file name and location.
- It is recommended that you change the display name so that it differs from the file name.
- If you like, change the temporary location of the EJB module from the default location, install_root/bin.
- Add at least one EJB component to the module.
- Add at least one enterprise bean to the EJB component. Use one or more of these methods:
- Import an existing JAR or EAR file containing EJB components.
- In the Navigation pane, right-click the EJB Components icon.
- Select Import from the pop-up menu.
- Click Browse to locate the archive file to import.
- Click Open to display the contents of the archive file.
- Select an EJB application from the archive file.
- Select the servlets or JSP files to be added and click Add to display the components in the Selected Components window.
- Click OK to add the selected components.
- Copy and paste values from an existing module.
- Create a new EJB component.
- In the Navigation pane, right-click the EJB Components icon.
- Select New from the pop-up menu.
- Enter the component name and archive type.
- Select class files.
- Click OK in the New EJB Component property dialog.
- Enter properties for the EJB component as needed. For information on the properties, see Assembly settings.
- Enter assembly properties for each bean.
- Click the plus sign (+) next to the component instance to show property groups.
- Right-click the icon for a property group.
- Select from the pop-up menu to add new values, or edit existing values in the property pane. For information on the properties, see Assembly settings.
- Add any other files needed by the application.
- Right-click the Files icon.
- Select Add Files from the pop-up menu.
- Select Browse to navigate the directory structure.
- Click Select to open an archive.
- Select the files to add and click Add.
- In the Selected Files window, click OK to add the files.