Migrating the Survey Application from Tomcat Web Server 4.1.12 to Sun Java System Application Server 8

Version 1.0

This document explains how to use the Migration Tool for Sun Java System Application Server 8 (hereafter called the Migration Tool) to migrate the Survey application from the Tomcat Web Server 4.1.12 source server to the Sun Java System Application Server 8 target server. The document also explains how to assemble, deploy, and run the sample application on the target server.

This document contains the following sections:

Overview
Migrating the Application
Deploying and Running the Migrated Application on the Target Server

Overview

Survey Overview briefly describes the Survey sample application.


Migrating the Application

This section describes how to migrate the application from the source server (Tomcat Web Server 4.1.12) to the target server (Sun Java Systems Application Server 8).

  1. Set the following environment variables that are used by the Migration Tool's build scripts:


  2. Start the Migration Tool in GUI mode:
  3. On Solaris:

      <ASMT_HOME>/bin> sh asmigrate.sh -u

    On Windows:

      <ASMT_HOME>\bin> asmigrate -u

    Invoking the Migration Tool in Command-Line Mode explains how to run the Migration Tool in command-line mode.

  4. Specify the Source Application (Input) details:

    1. Select "Archive" and specify the file <ASMT_HOME>/examples/tomcat_4_1_12/survey/survey.war as input to the Migration Tool.

    2. Select the Source Server as TomCat Web Server 4.1 from the dropdown list.

  5. Specify the Target Application (Output) details:

    1. Specify a Directory path of your choice to the location where the migrated output application should be written. From here on, this document will refer to this directory path as <OUTPUT_DIR>.

    2. Select the Target Server from the dropdown list. Your only choice is Sun Java Systems Application Server 8.

  6. Press the Migrate button.

    The Migration Tool creates a directory structure that contains the expanded archive, modified files, and generated build scripts in the output directory that you selected.


  7. Change to the <OUTPUT_DIR>/Input_Archives/Wars/survey directory and run the appropriate build script to generate the survey.war file:

    The build script generates the <OUTPUT_DIR>/Input_Archives/Wars/survey/asmtbuild/survey.war file.


Deploying and Running the Migrated Application on the Target Server

  1. Make sure that you have set the environment variables.

  2. If you are running the Survey application for the first time, you need to make sure that the application has the correct permissions to run in the Application Server environment. To do so, complete the following steps.

    1. Stop the Application Server.

    2. Open the Application Server's security policy file, server.policy, in a text editor. The file is in the Application Server's domains/domain1/server/config/server directory.

    3. Locate this line:

      permission java.io.FilePermission "<<ALL FILES>>", "read,write";

      Replace it with this line:

      permission java.io.FilePermission "<<ALL FILES>>", "read,write,execute,delete";

    4. Start the Application Server.

  3. Deploy survey.war, the migrated application.

    1. Change to the bin directory in the Application Server and run the following asadmin command:
      asadmin deploy --user username --password password 
        --host hostname --port adminport --type web 
        <OUTPUT_DIR>/Input_Archives/Wars/survey/asmtbuild/survey.war

      Replace the variables shown in a blue font with values appropriate for your own environment.

    2. On Solaris, unpack the <ASMT_HOME>/examples/tomcat_4_1_12/survey/data.zip file in your /usr/local directory. Create the directory if it does not already exist or open the Web-inf/web.xml file in the survey.war archive and set the value of the appDataDir element of the <context-param> tag from "/usr/local/survey/data/" (shown below in red) to "/<New_Directory_Location>/survey/data/".
      <context-param>
        <param-name>appDataDir</param-name>
        <param-value>/usr/local/survey/data/</param-value>
              .
              .
      </context-param>

      On Windows, unpack the ZIP file in the root of the drive on which the Application Server was installed (for example, C: or D:).

  4. Run the application:

    1. Access the deployed Survey application from the following URL:
        http://<machine_ip>:<port>/survey
    2. When prompted, enter "admin" for the username and "adminpass" for the password.

Index
Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved.