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

Each module has a deployment descriptor. When you deploy the module, you are asked to provide configuration information for the module. Here are some examples:
  • 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

Deploying by using the administrative console
  1. Back up your J2EE assets.
  2. Locate the WAR file that you created .
  3. 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.
  4. Windows Ensure that no system processes are accessing any file or directory in:
    • WC_profiledir/installedApps/WC_instance_name_cell
  5. Starting and stopping quick reference.
  6. Open the WebSphere Integrated Solutions Console.
  7. In the administrative console, expand Applications > Application Types > WebSphere enterprise applications .
  8. 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.
  9. 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.
    1. Select Replace or add a single module. More options are displayed.
    2. In the Specify the path beginning with the installed application archive file to the module to be replaced or added 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. If your WAR file is on the same machine as the Web browser used to connect to the administrative console:
      1. Under Specify the path to the module, select Local file system and specify the full path and file name to the WAR file.
    4. If your WAR file is on the server that your Web browser is connected to use the administrative console:
      1. Select Remote file system and specify the full path and file name to the WAR file.
      2. Click Next.
  10. In the Preparing for the application update page, click the optionDetailed - Show all installation options and parameters. Click Next.
  11. The Application Security Warnings page displays. Click Continue.
  12. 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.
  13. 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.
  14. Click Next in Provide JSP reloading options for Web modules page.
  15. Click Next in Map shared libraries page.
  16. Click Next in Map shared library relationships page.
  17. Click Next in Initialize parameters for servlets page.
  18. In Map virtual hosts for Web modules page, Select the Virtual host for the module.
    For example, select VH_demo_Tools.
  19. In Map context roots for Web modules page, ensure that the context root is correct. Example: lobtools
  20. Click Next in metadata for modules page.
  21. Click Finish in the summary page then the updating page displays.
  22. When the update completes, a message similar to the following is displayed: Update of WC_demo has ended.
  23. Click Save. Save directly to the master configuration. Save completes and the Enterprise Applications page displays.

Results

To delete assets:

  1. Back up your changed assets before deploying.
  2. Starting and stopping quick reference.
  3. Open the WebSphere Integrated Solutions Console.
  4. In the administrative console, expand Application > Application types> WebSphere enterprise applications.
  5. 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.
  6. Under Modules, click Manage Modules. Select the type of module you are working with (for example Web Modules).
  7. 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

  1. Back up your changed assets before deploying.
  2. Place the WAR module on the file system of the machine that is running the wsadmin tool.
  3. Start the wsadmin tool.
  4. 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.
    • 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.

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

For more information about the AdminApp command, see .