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).
- Set the following environment variables that are used by the Migration
Tool's build scripts:
- JAVA_HOME: J2SE SDK 1.4 installation directory
- J2EE_HOME: Sun Java Systems Application Server 8 installation
directory
- ASMT_HOME: Migration Tool installation directory
- AS_HOME: bin directory of the Sun Java Systems
Application Server 8 installation
- CLASSPATH: Include any application-specific library
classes that are required for compiling the application
- Start the Migration Tool in GUI mode:
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.
- Specify the Source Application (Input) details:
- Select "Archive" and specify the file
<ASMT_HOME>/examples/tomcat_4_1_12/survey/survey.war as
input to the Migration Tool.
- Select the Source Server as TomCat Web Server 4.1
from the dropdown list.
- Specify the Target Application (Output) details:
- 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>.
- Select the Target Server from the dropdown list. Your only choice is
Sun Java Systems Application Server 8.
- 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.
- Change to the
<OUTPUT_DIR>/Input_Archives/Wars/survey directory
and run the appropriate build script to generate the survey.war
file:
- On Solaris: sh build_war.sh
- On Windows: build_war
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
- Make sure that you have set the environment
variables.
- 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.
- Stop the Application Server.
- 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.
- 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";
- Start the Application Server.
- Deploy survey.war, the migrated application.
- 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.
- 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:).
- Run the application:
- Access the deployed Survey application from the following URL:
http://<machine_ip>:<port>/survey
- When prompted, enter "admin" for the username and "adminpass" for the
password.
Index
Copyright (c) 2004
Sun Microsystems, Inc. All rights reserved.