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:

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:

    pointbaseServer Start

  • On Windows, go Start Menu >Programs > PointBase Network 3.5 > PointBase Server.



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:

  1. From the Start menu, follow this path to open the Control Panel:

    Settings > Control Panel.

  2. Double click Services. You will see the screen shown in Figure 2- 1.

Figure 2-1    The Services Screen


  1. 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


  1. 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).

    (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).



  2. Click on the Stop button.

  3. Wait thirty seconds for all of the server processes to stop.

  4. Click on the Start button.

    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.

    Tip The server process logs can become voluminous. You might find it useful to increase the buffer size and the window size of the log windows. To find these settings, click the icon on the top left of the log window to enable the window menu. From the Properties menu item, select the Layout tab. The ensuing screen allows you to change the buffer and window sizes.




To Stop and Start the Server on Solaris

To stop and then restart the iPlanet Application Server on Solaris, follow these steps:

  1. Make sure that you are logged in as the root user.

  2. Change the current directory to: ias install directory/ias/bin/

  3. To stop the server, run this command:

./iascontrol stop

  1. Wait thirty seconds for all of the server processes to stop.

  2. To restart the server, run this command:

./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

  1. On Solaris, add installdir/ias/bin directory to your PATH environment variable: (the installdir directory is where you installed iPlanet Application Server.)

    On Windows, open a DOS command prompt by selecting Programs -> Command Prompt from the Start menu.

  2. Change the current directory to the hellodb source directory using this command:

    Solaris:

    cd installdir/ias/ias-samples/database/hellodb/src/schema

    Win NT

    cd installdir:\ias\ias-samples\database\hellodb\src\schema

  3. Register the data source with this command:

    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:

  1. If you are using Solaris, make sure the following directory is part of your PATH environment variable:

    installdir/ias/bin

    If you are using Windows NT, this step is automatically completed during the installation.

  2. Change the current directory to the hellodb source directory using this command:

    Solaris

    cd installdir/ias/ias-samples/database/hellodb/src/

    Windows

    cd installdir\ias\ias-samples\database\hellodb\src 

  3. Build the sample components using this command: build all

    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.



  4. Deploy the application to your application server using this command:

    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:

  1. removeweb webapp_name, to remove the web application.

  2. removeejb ejbjar_name, to remove EJBs.

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