Assemble EJB modules

Before you begin

If you want to use existing Java 2 Platform, Enterprise Edition (J2EE) Version 1.2 modules in your J2EE Version 1.3 application, migrate them to the Version 1.3 specification first.

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 is installed as a stand-alone application or is combined with other modules into an enterprise application.

To increase performance, break CMP enterprise beans into several enterprise bean modules during assembly. The load time for hundreds of beans is improved by distributing the beans across several JAR files and packaging them to an EAR file. Load time is faster when the administrative server attempts to start the beans, for example, 8-10 minutes versus more than one hour when one JAR file is used.

The Application Assembly Tool (AAT) 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

Steps for this task

  1. Start the AAT.
  2. From the New tab, select EJB Module. Click OK.
    The navigation tree displays various sets of properties for configuring the new EJB module.
  3. (Optional)   Use the property dialog shown in the AAT workspace to change the default file name and location.

    1. It is recommended that you change the display name so that it differs from the file name.
    2. If you like, change the temporary location of the EJB module from the default location, install_root/bin.

  4. Add at least one EJB component to the module.

    • Add at least one enterprise bean to the EJB component.

      • Import an existing JAR or EAR file containing EJB components.

        1. In the Navigation pane, right-click the EJB Components icon.
        2. Select Import from the pop-up menu.
        3. Click Browse to locate the archive file to import.
        4. Click Open to display the contents of the archive file. The applications in the selected archive file display.
        5. Select an EJB application from the archive file.
        6. Select the servlets or JSP files to be added, and click Add to display the components in the Selected Components window.
        7. Click OK to add the selected components.

      • Copy and paste values from an existing module.
      • Create a new EJB component.

        1. In the Navigation pane, right-click the EJB Components icon.
        2. Select New from the pop-up menu.
        3. Enter the component name and archive type.
        4. Select the class files.
        5. Click OK in the New EJB Component property dialog.
        6. Enter properties for the EJB component as needed.

  5. Enter assembly properties for each bean.

    1. Click the plus sign (+) next to the component instance to show property groups.
    2. Right-click the icon for a property group.
    3. Select New from the pop-up menu to add new values, or edit existing values in the property pane.

    If you change the session type (stateful or stateless) of a session bean, click Apply before making any other changes to the same bean. Otherwise, certain input fields on the GUI become inactive. (You will know they are inactive because they are grayed out on the GUI.) After making all of your changes, click Apply again to commit them.

  6. Add any other files needed by the application.

    1. Right-click the Files icon.
    2. Select Add Files from the pop-up menu.
    3. Select Browse to navigate the directory structure.
    4. Click Select to open an archive.
    5. Select the files to add and click Add.
    6. In the Selected Files window, click OK to add the files.

What to do next

Assemble any other new modules of your choice:

You can also migrate existing modules.

Another option is to proceed directly to assembling a new application module. While assembling an application module, you can create any new modules that you need.