Administer > Deploy > Deploying customized assets > Customized WebSphere Commerce Enterprise Application (EAR) assets > Deploying custom Java EE assets


Deploy a WAR module

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 we will be asked to provide configuration information for the module. Here are some examples:

The WebSphere Application Server 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 the J2EE assets before you deploy.

Deploying using the WebSphere administrative console

To add or update assets:


Procedure

  1. Backup the J2EE assets.

  2. Locate the WAR file that you created .

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

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

  5. Start the WebSphere Application Server administration server.

  6. Launch the WebSphere administrative console.

  7. In the WebSphere administrative console, expand Applications > Application Types > WebSphere Enterprise Applications .

  8. From the Enterprise Applications list, select the check box next to the J2EE application for the 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 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 the 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 the WAR file is on the same machine as the Web browser used to connect to the WebSphere 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 the WAR file is on the server that the Web browser is connected to use the WebSphere 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 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 the changed assets before deploying.

  2. Start the WebSphere Application Server administration server.

  3. Launch the WebSphere administrative console.

  4. In the WebSphere administrative console, expand Application > Application types> WebSphere enterprise applications.

  5. From the Enterprise Applications list, click the J2EE application for the instance. This will be WC_instance (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 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 the 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=server_name+WebSphere:cell=WC_ instance_cell,node=WC_ instance_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 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=server_name+WebSphere:cell=WC_ instance_cell,node=WC_ instance_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','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 the module has resource references or any other configuration, we 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

For more information about the AdminApp command, see Commands for the AdminApp object in the WebSphere Application Server 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


+

Search Tips   |   Advanced Search