Administer > Deploy > Deploying customized assets > Customized WebSphere Commerce Enterprise Application (EAR) assets > Package custom Java EE assets > Packaging Java EE assets for an entire module


Package the module with EJB backend conversion

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

To package an entire module, such as an EJB JAR file, for deployment, follow these steps. Note that if the EJB JAR file only contains session beans, then you do not have to complete these steps and can go directly to deploying the entire module.


Procedure

  1. Open the WebSphere Commerce Developer and switch to the Java EE perspective.

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

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

    • If you have 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.

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

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

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

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

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

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

    • jdbc/WebSphere Commerce iSeries DataSource demo where the target WebSphere Commerce Server is using a DB2 UDB for iSeries database, and the WCS 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 the custom enterprise beans than that used by the WebSphere Commerce enterprise beans, a two-phase commit will be required. Therefore, if the 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.

  7. Save the deployment descriptor changes.

  8. Close WebSphere Commerce Developer.

  9. At a command prompt, navigate to the following directory:

    WCDE_INSTALL\bin
    

  10. Enter the following command:

    ejbConvert.bat projName jarName [mapType]
    

    Where:

    projName

    The project to be deployed

    jarName

    The name of the EJB JAR file to create

    mapType

    Oracle

    The following is an example usage of this command with all values specified:

    ejbConvert WebSphereCommerceServerExtensionsData WebSphereCommerceServerExtensionsData.jar 
    

    The ejbconvert.bat command expects the input to be a DB2 back end.

  11. Open WebSphere Commerce Developer and open the EJB deployment descriptor and restore the modifications that were made previously, back to the setting that is required for the local test server. Save your changes.

  12. If you are collecting all assets to be deployed into a single directory (for example C:\ExportTemp), copy the newly created EJB JAR file into that directory.


Related tasks

Deploy customized assets

Package the module without EJB backend conversion


+

Search Tips   |   Advanced Search