Packaging your 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 your development environment.
About this task
Procedure
- Open the WebSphere Commerce Developer and switch to the Java EE perspective.
- 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.
- Double-click the Deployment Descriptor icon to editing the deployment descriptor.
- With the Overview tab selected, scroll to the bottom of the pane, to locate the JNDI - CMP Connection Factory Binding section.
- Record the value in the JNDI name field. You will restore this value after exporting the EJB JAR file.
- 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 WebSphere Commerce instance name is "demo"-
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" 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 forDatasourceName=
in the file. Important: 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, you must 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. - Save your deployment descriptor changes.
- Close WebSphere Commerce Developer.
- At a command prompt, navigate to the following directory:
WCDE_installdir\bin
- Enter the following command:
Where:ejbConvert.bat projName jarName [mapType]
- 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:
The ejbconvert.bat command expects the input to be a DB2 back end.ejbConvert WebSphereCommerceServerExtensionsData WebSphereCommerceServerExtensionsData.jar
- 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 your local test server. Save your changes.
- 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.