Deploying a WAR module
The single module option lets you deploy an entire WAR module to the Java Platform, Enterprise Edition application. Since there are many different types of modules in Java Platform, Enterprise Edition applications the steps can differ depending on the module type.
About this task
- 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 guide you through the process of configuring each module.
Here is the general process to use when you deploy an entire WEB module. The assumption is that you have packaged the Web module as recommended. Regardless of whether you use the graphical or scripting tools, always back up your Java Platform, Enterprise Edition assets before you deploy.
Procedure
Results
To delete assets:
- Back up your changed assets before deploying.
- Starting and stopping quick reference.
- Open the WebSphere Integrated Solutions Console.
- In the administrative console, expand Application > Application types> WebSphere enterprise applications.
- From the Enterprise Applications list, select the Java Platform, Enterprise Edition 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.
- Under Modules, click Manage Modules. Select the type of module you are working with (for example Web Modules).
- From the list of modules, select the module that you want to delete, and click
Remove.Note: Do not remove any module that is provided by the WebSphere Commerce product. Doing so breaks the product.
Deploying using the wsadmin tool
- Back up your changed assets before deploying.
- Place the WAR module on the file system of the machine that is running the wsadmin tool.
- Start the wsadmin tool.
- Update the Java Platform, Enterprise Edition application with the new module. Run the following
commands (depending on the language you chose):
- 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 -contextroot context_root -MapModulesToServers {{ module_name module_file,WEB-INF/web.xml WebSphere:cell=WC_ instance_name_cell,node=WC_ instance_name_node,server=server_name+WebSphere:cell=WC_ instance_name_cell,node=WC_ instance_name_node,server=webserver1}} -MapWebModToVH {{ module_name module_file,WEB-INF/web.xml virtual_host}}}
AdminConfig.save()
For example:
$AdminApp update WC_demo modulefile {-operation addupdate -contents C:/ibm/LOBTools.war -contenturi "LOBTools.war" -contextroot /lobtools -MapModulesToServers {{LOBTools LOBTools.war,WEB-INF/web.xml WebSphere:cell=WC_demo_cell,node=WC_demo_node,server=server1+WebSphere:cell=WC_demo_cell,node=WC_demo_node,server=webserver1}} -MapWebModToVH {{LOBTools LOBTools.war,WEB-INF/web.xml VH_demo_Tools}}}
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 MyModule.war
Note: Do not remove any module that is provided by the WebSphere Commerce product. Doing so breaks the product.
- 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 -contextroot context_root -MapModulesToServers [[ module_name module_file,WEB-INF/web.xml WebSphere:cell=WC_instance_name_cell,node=WC_ instance_name_node,server=server_name+WebSphere:cell=WC_ instance_name_cell,node=WC_ instance_name_node,server=webserver1]] -MapWebModToVH [[ module_name module_file,WEB-INF/web.xml virtual_host]]]')
AdminConfig.save()
For example:
AdminApp.update('WC_demo','modulefile','[-operation addupdate -contents C:/ibm/LOBTools.war -contenturi "LOBTools.war" -contextroot /lobtools -MapModulesToServers [[LOBTools LOBTools.war,WEB-INF/web.xml WebSphere:cell=WC_demo_cell,node=WC_demo_node,server=server1+WebSphere:cell=WC_demo_cell,node=WC_demo_node,server=webserver1]] -MapWebModToVH [[LOBTools LOBTools.war,WEB-INF/web.xml VH_demo_Tools]]]')
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]')
Note: Do not remove any module that is provided by the WebSphere Commerce product. Doing so breaks the product.
- To add or update assets:
- Jacl
If your module has resource references or any other configuration, you must 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