Deploying J2EE assets for an entire module
The single module option provides the ability to deploy an entire module to the J2EE application. Since there are many different types of modules in J2EE applications the steps can differ depending on the module type.
- EJB modules require data sources
- Web modules require context roots and virtual hosts
- Both EJB and Web modules can declare resource references; these must be bound to the actual resources at deployment time
The WebSphere Application Server deployment tools will guide you through the process of configuring each module.
The most common types of modules deployed with WebSphere Commerce are EJB modules. Here is the general process to use when deploying EJB modules. The assumption is that you have packaged the EJB modules as recommend. Note that regardless of whether you use the graphical or scripting tools, always back up your J2EE assets before you deploy.
Procedure
-
Deploying using the WebSphere administrative console
-
To delete assets:
- Back up your changed assets before deploying.
- Starting and stopping quick reference.
- Open the WebSphere Integrated Solutions Console.
- In the WebSphere administrative console, click .
- From the Enterprise Applications list, click the J2EE application for your instance. This will be WC_ instance_name (for example, WC_demo). This displays the Enterprise Applications properties, showing the Configurations tab first.
- Click Manage Module.
- From the list of modules, select the EJB module you want to delete, and click
Remove.Note: Do not remove any default modules.
-
Deploying using the wsadmin tool
- Back up your changed assets before deploying.
- Place the EJB JAR file containing your changed module on the file system of the machine running the wsadmin tool
- Start the wsadmin tool.
- Update with the J2EE application with the new module. Ensure that your correctly specify the correct JNDI name of the WebSphere Commerce data source to be used by this module.
- Run the following commands depending on the language you have chosen:
-
JACL
- To add or update assets:
$AdminApp update WC_instance_name modulefile {-operation addupdate -contents path to source module -contenturi path to module in EAR -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "datasource JNDI Name" -defaultbinding.cf.jndi "datasource JNDI Name" -defaultbinding.cf.resauth Per_Connection_Factory }
$AdminConfig save
For example:
$AdminApp update WC_prod modulefile {-operation addupdate -contents /deployments/2007-01-01a/WebSphereCommerceServerExtensionsData.jar -contenturi WebSphereCommerceServerExtensionsData.jar -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.resauth Per_Connection_Factory}
$AdminConfig save
- To delete assets:
$AdminApp update WC_instance_name modulefile {-operation delete -contenturi path to module in EAR}
For example:
$AdminApp update WC_prod modulefile {-operation delete -contenturi WebSphereCommerceServerExtensionsData.jar}
$AdminConfig save
- To add or update assets:
-
Jython
- To add or update assets:
AdminApp.update('WC_instance_name','modulefile','[-operation addupdate -contents path to source module -contenturi path to module in EAR -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "datasource JNDI Name" -defaultbinding.cf.jndi "datasource JNDI Name" -defaultbinding.cf.resauth Per_Connection_Factory]')
AdminConfig.save()
For example:
AdminApp.update('WC_prod','modulefile','[-operation addupdate -contents /deployments/2007-01-01a/WebSphereCommerceServerExtensionsData.jar -contenturi WebSphereCommerceServerExtensionsData.jar -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.resauth Per_Connection_Factory]')
AdminConfig.save()
- To delete assets:
AdminApp.update('WC_instance_name','modulefile','[-operation delete -contenturi path to module in EAR]')
AdminConfig.save()
For example:
AdminApp.update('WC_prod','modulefile','[-operation delete -contenturi WebSphereCommerceServerExtensionsData.jar]')
AdminConfig.save()
- To add or update assets:
-
If your module has resource references or any other configuration, you will need to add some additional options to the third parameter. To obtain a list of all options for the module, you can run the following command:
$AdminApp options path to source module