Assemble the application: Assemble the EJB module

The application assembly tool is used to package the enterprise bean files into an EJB module. The EJB module is used in later steps to assemble an application and deploy it into a WebSphere Application Server instance. The end result of an EJB module is a JAR file that contains enterprise bean files.

  1. Start the application assembly tool. On your workstation, select Start --> Programs -> IBM Websphere -> Application Server v5.0 -> Application Assembly Tool.

  2. The Welcome to the Application Assembly Tool window is displayed. On the New tab, click EJB Module, and click OK.

    The application assembly tool uses a navigation bar to access various parts of the interface. The EJB module file has a default name and directory structure and contains general EJB module information.

  3. Set up general EJB module information.

    • On the General tab, specify the following:

      • In the Display name field, specify Increment.
      • Optionally, you can specify a description in the Description field.
      • Click Apply.

    • On the CMP Resource Bindings tab, specify the following:

      • In the JNDI name field, specify jdbc/HitCount.
      • Click Apply.

  4. Add the HitCount sample application files to the application assembly tool.

    • In the navigation bar, right-click Files, and select Add Files.

    • Click Browse, and navigate to the /hcsample directory.
    • Select hcsample, and click Select.

      Note: Do not double-click to open the hcsample directory. You may have to go up one level to be able to select the hcsample folder, because it is created at the root of your server's directory path.

    • Select com in the list that appears in the window.
    • Click Add.
    • Click OK.

  5. Add the enterprise bean files.

    • In the navigation bar, right-click Entity Beans, and select New -> CMP.
    • In the EJB name field, specify Increment.
    • In the Display name field, specify Incrementejb.
    • Optionally, you can specify a description in the Description field.
    • In the EJB class field, click Browse.
    • Navigate to the defaultapplication folder (located in the /com/ibm directory structure), and select IncrementBean.class.
    • Click OK.
    • In the Remote: Home field, click Browse.
    • Navigate to the defaultapplication folder, and select IncrementHome.class.
    • Click OK.
    • In the Remote: Interface field, click Browse.
    • Navigate to the defaultapplication folder, and select Increment.class.
    • Click OK.
    • On the Advanced tab, click Browse next to the Primary key class field.
    • Navigate to the defaultapplication folder, and select IncrementKey.class.
    • Click OK.
    • In the Primary key field, make sure Compound key is displayed.
    • In the Version field, make sure 2.x is displayed.
    • In the Abstract schema name field, specify Increment.
    • Click OK.
    • In the navigation bar, expand Entity Beans, expand Incrementejb, right-click CMP fields, and click New.
    • Select Primary Key from the drop-down list, and click OK.
    • Right-click CMP fields again, and click New.
    • Select TheValue from the drop-down list, and click OK.

  6. Save your EJB module.

    • Select the File -> Save menu item to save your EJB module in the hcsample folder.
    • Save your EJB module as Increment.jar.
    • Click OK.

  7. Select the File -> Close menu item to close the file.

Continue Next: Assemble the Web module