Deploying J2EE assets for a single file

By deploying assets for a single file, you can deploy the single file assets into the J2EE application.

About this task

Do not use this option when the single file is a J2EE module. J2EE modules must be deployed as an entire module.

Use this option to deploy any single asset, such as:

  • A single Java JAR file that contains:
    • Controller commands
    • Data beans
    • Utility classes
  • A store asset, such as:
    • A JSP file
    • An HTML file
    • A configuration XML file
    • An image file
    • A properties files or resource bundle
Note: If you are deploying more than one file, it is best to group the files together and use the partial application procedure. This procedure can be faster than completing several single file updates.

Consider the following scenario: a problem exists within a JSP file. The developer updates the file and tested it in the development environment. The functional tester validates the change in the quality assurance environment. It is now time to deploy the changed file into your production server. Always back up your J2EE assets before you deploy, regardless of whether you use the graphical or scripting tools.

Procedure

  • Deploying assets with the WebSphere Application Server administrative console:
    1. Backup your J2EE assets.
    2. Place the changed file or JAR file either on the machine where the administrative console is running, or on the machine that includes the web browser you are using to access the administrative console.
    3. Starting and stopping quick reference.
    4. Open the WebSphere Integrated Solutions Console.
    5. In the administrative console, expand Applications > Application types > WebSphere enterprise applications.
    6. From the Enterprise Applications list, select the check box next to the J2EE application for your instance. By default, this application WC_instance_name. For example, WC_demo. Click Update.
    7. On the Preparing for Application Update page, under the Application update options section:
      Note: If you are typing in the directory paths, always use forward slashes no matter which platform you are using. Do not use a leading slash as a prefix.
      1. Select Replace or add a single file. More options that are specific to a single file deployment display. Your screen can resemble the following image:
        Specify the EAR, WAR, JAR, or SAR module to upload and install. A screen capture of the WebSphere Application Server administrative console.
      2. In the text box under the Specify the path to the beginning with the installed application archive file to the file to be replaced or added:, specify the path to the file to be replaced or added. Beginning with the installed application archive file, type the path and file name of your changed file. This path is the path in the EAR file. It is relative to the root of the EAR file. For example, if you changed a JSP file for your store, called myfile.jsp, your relative path, and file name would be similar to Stores.war/myStore/myfile.jsp. If your change is for a controller command, data bean, or Java code, then specify the relative path and file name to the JAR file you packaged.
      3. In the Specify the path to the file section:
        • If your changed file is on the same machine as the web browser used to connect to the administrative console:
          1. Select Local file system and specify the full path and file name to your changed file. If your change is for a controller command, data bean, or Java code, then specify the path and file name to the JAR file you packaged.
          2. Click Next.
        • If your changed 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 your changed file. If your change is for a controller command, data bean, or Java code, then specify the path and file name to the JAR file you packaged.
          2. Click Next.
    8. The Updating Application page displays with a confirmation message, indicating your file is updated. Click OK.
    9. WebSphere Application Server saves the updates and deploys the file. On the Updating page, click Save to save directly to the master configuration.
  • Deploying assets with the wsadmin tool
    1. Backup your J2EE assets.
    2. Place the changed file or JAR file on the file system of the machine that is running the wsadmin tool.
    3. Start the wsadmin tool.
    4. Run the following command for your programming language:
      • Jacl
        $AdminApp update WC_ instance_name file {-operation addupdate -contents path on local file system to source file - contenturi path within EAR 
        $AdminConfig save 
        For example:
        $AdminApp update WC_demo file {-operation addupdate -contents /deployments/2007-01-01a/Stores.war/myStore/index.jsp -contenturi Stores.war/myStore/index.jsp} 
        $AdminConfig save 
      • Jython
        AdminApp.update('WC_ instance_name', 'file', '[-operation addupdate -contents path on local file system to source file -contenturi path within EAR]') 
        AdminConfig.save()
        For example:
        AdminApp.update('WC_demo', 'file', '[-operation addupdate -contents /deployments/2007-01-01a/Stores.war/myStore/index.jsp -contenturi Stores.war/myStore/index.jsp]') 
        AdminConfig.save()