Deploy a WAR module

+

Search Tips   |   Advanced Search

The single module option provides the ability to deploy an entire WAR 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. Each module has a deployment descriptor. When deploying the module you will be asked to provide configuration information for the module. Here are some examples:

The WAS deployment tools guides you through the process of configuring each module.

Here is the general process to use when deploying an entire WEB module. The assumption is that you have packaged the Web module as recommend. Note that regardless of whether you use the graphical or scripting tools, always back up your J2EE assets before you deploy.

Deploying using the WebSphere console

To add or update assets:

  1. Backup your J2EE assets.

  2. Locate the WAR file that you created .

  3. Place the WAR file either on the machine running the WebSphere console or the machine running the Web browser you are using to access the WebSphere console.

  4. Windows:

    Ensure that no system processes are accessing any file or directory in:

  5. Start the WAS administration server.

  6. Launch the WebSphere console.

  7. In the WebSphere console, expand Applications > Enterprise Applications.

  8. From the Enterprise Applications list, select the check box next to the J2EE application for your instance. This will be WC_instance (for example, WC_demo). Click Update.

  9. On the Preparing for the application installation page, under the Application update options section:

    If you are typing in the directory paths, you should always use forward slashes no matter which platform you are using. You should never prefix with a leading slash.

    1. Select Single module. More options which are specific to the single module deployment are displayed.

    2. In the Relative path to module field, type the path and file name to your WAR file. This is the path as it should be in the EAR file. It is relative to the root of the EAR file.

    3. Under Upload the new or replacement module:

      • If your WAR file is on the same machine as the Web browser used to connect to the WebSphere console:

        1. Select Local file system and specify the full path and file name to the WAR file.

        2. Enter the Context root that the Web module uses. For example, the Management Center Web module uses a context root of /lobtools.

        3. Click Next.

      • If your WAR file is on the server that your Web browser is connected to use the WebSphere console:

        1. Select Remote file system and specify the full path and file name to the WAR file.

        2. Enter the Context root that the Web module uses. For example, the Management Center Web module uses a context root of /lobtools.

        3. Click Next.

    4. Maintain the settings on the bindings page and click Next.

  10. The Application Security Warnings page displays. Click Continue.

  11. 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.

  12. Click Map modules to servers link on the left navigation frame. Check the Select box for the module. Select both the Web server and server (or cluster). Click Apply.

  13. Click Map virtual hosts for Web modules on the left navigation frame. Select the Virtual host for the module. For example, select VH_demo_Tools.

  14. Click Summary on the left navigation frame. Review the selections and click Finish.

  15. When the update completes a message, similar to the following, is shown:
    Application WC_demo installed successfully.
    
    Click Save to Master Configuration. Click Save.

To delete assets:

  1. Back up your changed assets before deploying.

  2. Start the WAS administration server.

  3. Launch the WebSphere console.

  4. In the WebSphere console, expand Application > Enterprise Applications.

  5. From the Enterprise Applications list, click the J2EE application for your instance. This will be WC_instance (for example, WC_demo). This displays the Enterprise Applications properties, showing the Configurations tab first.

  6. Under Related Items, select the type of module you are working with (for example Web Modules).

  7. From the list of modules, select the module you want to delete, and click Remove.

    Do not remove any module that is provided by the WebSphere Commerce product. Doing so will break the product.

Deploy using the wsadmin tool

  1. Back up your changed assets before deploying.

  2. Place the WAR module on the file system of the machine running the wsadmin tool.

  3. Start the wsadmin tool.

  4. Update the J2EE application with the new module. Run the following commands depending on the language you have chosen:

    • JACL

      • To add or update assets:

        $AdminApp update WC_ instance 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_cell,node=WC_ instance_node, server= servername+WebSphere:cell=WC_ instance_cell,node=webserver1_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:/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=webserver1_node,server=webserver1}} -MapWebModToVH {{LOBTools LOBTools.war,WEB-INF/web.xml VH_demo_Tools}}}

        $AdminConfig save

      • To delete assets:

        $AdminApp update WC_ instance modulefile {-operation delete -contenturi path to module in EAR}

        For example:

        $AdminApp update WC_prod modulefile {-operation delete -contenturi MyModule.war

        Do not remove any module that is provided by the WebSphere Commerce product. Doing so will break the product.

    • Jython

      • To add or update assets:

        AdminApp.update('WC_instance','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_cell,node=WC_ instance_node,server=servername+ WebSphere:cell=WC_ instance_cell,node=webserver1_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:/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=webserver1_node,server=webserver1]] -MapWebModToVH [[LOBTools LOBTools.war,WEB-INF/web.xml VH_demo_Tools]]]')

        AdminConfig.save()

      • To delete assets:

        AdminApp.update('WC_ instance','modulefile','[-operation delete -contenturi path to module in EAR]')

        For example AdminApp.update('WC_prod','modulefile','[-operation delete -contenturi WebSphereCommerceServerExtensionsData.jar]')

        Do not remove any module that is provided by the WebSphere Commerce product. Doing so will break the product.

If your module has resource references or any other configuration, 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

For more information about the AdminApp command, see Commands for the AdminApp object in the WAS information center.

Related tasks

Deploy custom J2EE assets
Validate changes have been deployed for a custom Enterprise Application (EAR) file
Compiling JavaServer Page files

Related reference

Troubleshoot: Deployment