Package your module without EJB backend conversion

This task is applicable if you created an EJB JAR file that is being deployed to a target WebSphere Commerce Server that uses the same type of database as your development environment.

  1. Open WebSphere Commerce Developer and switch to the J2EE perspective.

  2. Depending on what your EJB JAR file contains, do one of the following steps:

    • If your EJB JAR file contains only session beans, then skip this step. You do not need to update your data source information, and you can simply export your changes.

    • If your EJB JAR file contains more than just session beans:

      1. Expand the EJB project that contains the bean or beans that you are deploying:

        • If you created new enterprise beans, expand the WebSphereCommerceServerExtensionsData EJB project (or the name of a new custom EJB project that contains the changes).

        • If you modified WebSphere Commerce entity beans, expand the project that contains the modified bean. For example, if you have modified the User bean, expand the Member-MemberManagementData EJB project.

      2. Double-click the Deployment Descriptor icon to editing the deployment descriptor.

      3. With the Overview tab selected, scroll to the bottom of the pane, to locate the JNDI - CMP Connection Factory Binding section.

      4. Record the value in the JNDI name field. You will restore this value after exporting the EJB JAR file.

      5. In the JNDI name field, enter the data source JNDI name of the target WebSphere Commerce Server. For example:

        • (DB2) jdbc/WebSphere Commerce DB2 DataSource demo where the target WebSphere Commerce Server is using a DB2 database, and the WebSphere Commerce instance name is "demo"

        • (Oracle) jdbc/WebSphere Commerce Oracle DataSource demo where the target WebSphere Commerce Server is using an Oracle database, and the WebSphere Commerce instance name is "demo".

        • I5/OS|jdbc/WebSphere Commerce iSeries DataSource demo where the target WebSphere Commerce Server is using a DB2 UDB for iSeries database, and the WebSphere Commerce instance name is "demo"

        Tip: The value for the DataSource JNDI name field is created by adding "jdbc/" to the data source name of the target WebSphere Commerce Server. You can verify the data source name by opening the WebSphere Commerce configuration file on the target WebSphere Commerce Server and searching for DatasourceName= in the file.

        If you specify a different data source for your custom enterprise beans than that used by the WebSphere Commerce enterprise beans, a two-phase commit will be required. Therefore, if your custom enterprise beans use the same database as the WebSphere Commerce enterprise beans, use the same data source name, so as to avoid a two-phase commit. In general, the use of two-phase commit JDBC drivers with WebSphere Commerce is not recommended.

      6. Save your deployment descriptor changes and close the file.

  3. Deploy your EJB project prior to exporting your EJB JAR file. In the Project Explorer view, right-click the EJB project (either WebSphereCommerceServerExtensionsData or the project that contains the modified WebSphere Commerce entity bean) and click Deploy.

  4. In the Project Explorer view, right-click the EJB project (either WebSphereCommerceServerExtensionsData or the project that contains the modified WebSphere Commerce entity bean) and click Export > EJB JAR File.

  5. In the Export wizard:

    1. The EJB project name is pre-populated. Leave this value as is.

    2. For the destination, enter the fully-qualified JAR file name to use. For example, enter C:\ExportTemp\JarFileName.jar where JarFileName is the name of your JAR file. If you created new enterprise beans, you should enter yourDir\WebSphereCommerceServerExtensionsData.jar. If you modified an existing WebSphere Commerce public entity bean, use the predefined JAR file name for this EJB group. For example, if your modification was in the Member-MemberManagementData EJB module, enter yourDir\Member-MemberManagementData.jar.

    3. Ensure that Export source files is not selected.

    4. Click Finish.

  6. After the export completes, open the EJB deployment descriptor and restore the modifications that were made previously back to the setting that is required for your local test server. Save your changes.

Related tasks

Stages of deploying customized assets
Package your module with EJB backend conversion