Previous Contents Index DocHome Next |
iPlanet Application Server Getting Started Guide |
Chapter 2 Deploying Applications
This chapter describes the steps necessary to deploy the Hello DB sample application provided with iPlanet Application Server 6.0.Topics covered in this chapter:
Starting PointBase Database Server
For more detailed information on building and packaging applications, see the iPlanet Application Server Developer's Guide.
Starting PointBase Database Server
PointBase Network 3,5 is a database server provided with iPlanet Application Server to test your applications. If you have not stopped the database server or restarted your system since you installed iPlanet Application Server, you do not need to start the PointBase Database Server. The examples in this guide assume that you are running the PointBase Database Server.If the PointBase Database Server is not running, you should follow these steps before continuing with the guide:
On Solaris, go to the installdir/pointbase/network/bin and type:
On Windows, go Start Menu >Programs > PointBase Network 3.5 > PointBase Server.
- pointbaseServer Start
Stopping and Starting the iPlanet Application Server
Because the server is automatically started during installation, you must first stop it before you can start it. Directions are provided for both Windows NT and for Solaris.
To Stop and Start the Server on Windows
The iPlanet Application Server is automatically installed as a Windows service. To stop, and start the sever, and to set service properties, follow these steps:
From the Start menu, follow this path to open the Control Panel:
Double click Services. You will see the screen shown in Figure 2- 1.
- Settings > Control Panel.
Figure 2-1    The Services Screen
Highlight iPlanet Application Server 6.0 and click Startup.
- You will see the screen shown in Figure 2-2.
Figure 2-2    The Service Parameters Screen
Turn on the Allow Service to Interact with Desktop flag (see arrow 1), and click OK. This returns you to the Services screen (Figure 2 -1).
Click on the Stop button.
- (Though this step is unrelated to starting and stopping the server, it will be useful later to view the logs while the application is running.)
Tip If you prefer to manually start the server instead of automatically starting it at system startup, you can also select the Manual option in the Startup Type box (see arrow 2 in Figure 2-2).
Wait thirty seconds for all of the server processes to stop.
- Since you are now allowing the service to interact with the desktop, you now have five additional pop-up windows on your desktop. These show the logs of the different components.
To Stop and Start the Server on Solaris
To stop and then restart the iPlanet Application Server on Solaris, follow these steps:
Make sure that you are logged in as the root user.
./iascontrol stopChange the current directory to: ias install directory/ias/bin/
Wait thirty seconds for all of the server processes to stop.
./iascontrol start
Registering the Data Source
You will now register the database information with the iPlanet Application Server as a data source named jdbc/hellodb/HelloDB.This registration will define the connection parameters to the database your application needs.
To Register the Data Source on Solaris and Windows
On Solaris, add installdir/ias/bin directory to your PATH environment variable: (the installdir directory is where you installed iPlanet Application Server.)
Change the current directory to the hellodb source directory using this command:
- On Windows, open a DOS command prompt by selecting Programs -> Command Prompt from the Start menu.
Register the data source with this command:
- Solaris:
- cd installdir/ias/ias-samples/database/hellodb/src/schema
- Win NT
- cd installdir:\ias\ias-samples\database\hellodb\src\schema
- iasdeploy regdatasource hellodb-pointbase-type4.xml
- The file hellodb-pointbase-type4.xml contains the deployment descriptor for the data source. You can view the file to see that it contains all the information necessary to create a JDBC connection.
Building the Application
Now you are ready to build the application. iPlanet Application Server includes several samples installed in installdir/ias/ias-samples. iPlanet Application Server 6.0, includes the Java-based build tool, Ant, which uses an XML-based configuration file analogous to traditional make files. Each sample includes a build.xml with build instructions for its components.
To Build the Application
To build the application, follow these steps:
If you are using Solaris, make sure the following directory is part of your PATH environment variable:
Change the current directory to the hellodb source directory using this command:
- installdir/ias/bin
- If you are using Windows NT, this step is automatically completed during the installation.
Build the sample components using this command: build all
- Solaris
- cd installdir/ias/ias-samples/database/hellodb/src/
- Windows
- cd installdir\ias\ias-samples\database\hellodb\src
Deploy the application to your application server using this command:
- This command will compile all the Java source files in the sample, build the WAR and JAR components, and assemble them into an EAR file.
Tip The WAR, JAR, and EAR files are the standard J2EE packaging components. For detailed information about packaging, see Packaging J2EE Applications for the iPlanet Application Server.
- build install
- This command will register the hellodb application with the iPlanet Application Server using the iasdeploy utility included with the product. This utility uses the application components and deployment descriptors stored in the EAR file to determine how to install hellodb on the application server.
Viewing the Application
Your hellodb application is now installed and ready to be executed.Enter the number of the network port used by your web server in place of the [PORT_NUMBER], and enter this URL:
http://127.0.0.1:[PORT_NUMBER]/NASApp/hellodb/index.html
You will see the screen shown in Figure 2 - 3.
Figure 2-3    HelloDB sample application
Undeploying Applications
Use iasdeploy to cleanly undeploy applications.For example: iasdeploy removeapp application_ear_file.
You can also use the J2EE application name as the argument, such as:
iasdeploy removeapp j2ee_app_name
Some of the other options, include:
Use iasdeploy -help command to see all available options.
Previous Contents Index DocHome Next
Copyright © 2001 Sun Microsystems, Inc. Some preexisting portions Copyright © 2001 Netscape Communications Corp. All rights reserved.
Last Updated November 09, 2001