Deploying J2EE assets for an entire module

The single module option provides the ability to deploy an entire 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 that describes the module itself. When deploying the module you will be 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 will guide you through the process of configuring each module.

The most common types of modules deployed with WebSphere Commerce are EJB modules. Here is the general process to use when deploying EJB modules. The assumption is that you have packaged the EJB modules as recommend. Note that regardless of whether you use the graphical or scripting tools, always back up your J2EE assets before you deploy.

Procedure

  • Deploying using the WebSphere administrative console
    1. Backup your J2EE assets.
    2. Place the EJB JAR file containing your changed module either on the machine running the WebSphere administrative server (the one you point your web browser to) or the machine running the Web browser.
    3. Starting and stopping quick reference.
    4. Open the WebSphere Integrated Solutions Console.
    5. In the WebSphere administrative console, click Applications > Application Types > WebSphere Enterprise Applications.
    6. Select your application name and click Update. Your application name will be WC_ instance_name (for example, WC_demo).
    7. Select Replace or add a single module.
    8. 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 EJB JAR file. This is the path as it should be in the EAR file. It is relative to the root of the EAR file. Typically, if you are updating an existing module, then the JAR file is at the root of the EAR and only the file name is required. If you are adding a new EJB module, you could place it in a subdirectory of the EAR file. In this situation, you must specify the relative path to the root of the EAR (for example, if your file is called myNewModule.jar, then your relative path and file name would be similar to myNewModules/myNewModule.jar).
    9. If you are running the WebSphere Application Server administrative console on the target machine, select Local file system, as the files are local to your browser. If you are running the WebSphere Application Server administrative console on a different machine, select Remote file system, as the files are remote to your browser.
    10. In the Specify the path to the module section, specify the path to the EJB JAR file. For example, drive:\ImportTemp\WebSphereCommerceServerExtensionsData.jar.
    11. Click Next.
    12. On the Preparing for Application Update page:
      1. In the How do you want to install the application section, check Detailed - Show all installation options and parameters.
      2. In the Specify bindings to use field, select use new bindings.
      3. Check Generate Default Bindings.
      4. Check Default connection factory bindings. Complete the fields:
        Option Description
        JNDI name Enter the datasource JNDI name of the target WebSphere Commerce Server. For example:
        • DB2 jdbc/WebSphere Commerce DB2 DataSource instance_name
        • Oraclejdbc/WebSphere Commerce Oracle DataSource instance_name
        Resource Authorization Select Container

      Leave all other default values.

    13. Click Next.
    14. On the Application Security Warnings screen, click Continue.
    15. On the Install New Application screen, select Step 5: Map default data sources for modules containing 1.x entity beans Complete the Target Resource JNDI Name field.
      Option Description
      Target Resource JNDI Name Enter the datasource JNDI name of the target WebSphere Commerce Server. For example:
      • DB2 jdbc/WebSphere Commerce DB2 DataSource instance_name
      • Oraclejdbc/WebSphere Commerce Oracle DataSource instance_name
    16. Review and verify the information in all the steps. When satisfied select Step 10: Summary.
    17. A summary of changes displays. A warning may appear regarding WAS 4.0 datasources. It can be ignored. Click Finish.
    18. When the update completes successfully, click Save to Master Configuration.
    19. On the WebSphere Enterprise Applications screen, click Save to save your changes to the master configuration. All your changes are saved.
    20. If your application is installed in a WebSphere Application Server cluster then ensure you synchronize the changes to all nodes.
    21. Close the WebSphere Application Server administration console.
  • 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 WebSphere administrative console, click Applications > Application Types > WebSphere Enterprise Applications.
    5. From the Enterprise Applications list, click the J2EE 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. Click Manage Module.
    7. From the list of modules, select the EJB module you want to delete, and click Remove.
      Note: Do not remove any default modules.
  • Deploying using the wsadmin tool
    1. Back up your changed assets before deploying.
    2. Place the EJB JAR file containing your changed module on the file system of the machine running the wsadmin tool
    3. Start the wsadmin tool.
    4. Update with the J2EE application with the new module. Ensure that your correctly specify the correct JNDI name of the WebSphere Commerce data source to be used by this module.
    5. Run the following commands depending on the language you have chosen:
      • 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 -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "datasource JNDI Name" -defaultbinding.cf.jndi "datasource JNDI Name" -defaultbinding.cf.resauth Per_Connection_Factory }

          $AdminConfig save

          For example:

          $AdminApp update WC_prod modulefile {-operation addupdate -contents /deployments/2007-01-01a/WebSphereCommerceServerExtensionsData.jar -contenturi WebSphereCommerceServerExtensionsData.jar -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.resauth Per_Connection_Factory}

          $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}

          $AdminConfig save

      • 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 -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "datasource JNDI Name" -defaultbinding.cf.jndi "datasource JNDI Name" -defaultbinding.cf.resauth Per_Connection_Factory]')

          AdminConfig.save()

          For example:

          AdminApp.update('WC_prod','modulefile','[-operation addupdate -contents /deployments/2007-01-01a/WebSphereCommerceServerExtensionsData.jar -contenturi WebSphereCommerceServerExtensionsData.jar -nodeployejb -usedefaultbindings -defaultbinding.datasource.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.jndi "jdbc/WebSphere Commerce DB2 DataSource prod" -defaultbinding.cf.resauth Per_Connection_Factory]')

          AdminConfig.save()

        • To delete assets:

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

          AdminConfig.save()

          For example:

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

          AdminConfig.save()

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