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
- Back up your J2EE assets.
- Locate the WAR file that you created .
- Place the WAR file either on the machine that is running the administrative console or the machine that is running the Web browser that you are using to access the administrative console.
Ensure that no system processes are accessing any file or directory in:
- WC_profiledir/installedApps/WC_instance_name_cell
- Starting and stopping quick reference.
- Open the WebSphere Integrated Solutions Console.
- In the administrative console, expand .
- From the Enterprise Applications list, select the check box next to the Java Platform, Enterprise Edition application for your instance. This will be WC_ instance_name (for instance, WC_demo). Click Update.
-
Preparing for Application Update page, under the Application update
options section:
Note: If you are typing in the directory paths, you must always use forward slashes no matter which platform you are using. You must never prefix with a leading slash.
- In the Preparing for the application update page, click the optionDetailed - Show all installation options and parameters. Click Next.
- The Application Security Warnings page displays. Click Continue.
- The Install New Application wizard opens, with Step 1: Select installation options as the first page. You do not need to specify anything on this page. Click Next.
- In Map modules to servers page, check the Select box for the module. Select both the (use the Ctrl key) Web server and server (or cluster). Click Apply. Click Next.
- Click Next in Provide JSP reloading options for Web modules page.
- Click Next in Map shared libraries page.
- Click Next in Map shared library relationships page.
- Click Next in Initialize parameters for servlets page.
-
In Map virtual hosts for Web modules page, Select the Virtual host for
the module.
For example, select VH_demo_Tools.
- In Map context roots for Web modules page, ensure that the context root is correct. Example: lobtools
- Click Next in metadata for modules page.
- Click Finish in the summary page then the updating page displays.
- When the update completes, a message similar to the following is displayed: Update of WC_demo has ended.
- Click Save. Save directly to the master configuration. Save completes and the Enterprise Applications page displays.
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