Previous     Contents     Index     Next     
iPlanet Application Server Migration Guide



Chapter 3   Running NAS 2.1 Applications


This chapter describes how to run NAS 2.1 applications on iPlanetTM Application Server 6.0 without making any source-level changes. Information on setting up the online Bank example is at the end of the chapter. It is recommended you set up the Bank example first before running your own applications on iPlanet Application Server 6.5. The Bank example will help you walk through a step by step migration.

iPlanet Application Server 6.5 is completely backward-compatible with NAS 2.1. In other words, you should be able to deploy your older NAS 2.1 application on iPlanet Application Server 6.5 without code alteration. However, implementation requires some steps. For example, C++ applications and extensions must be recompiled before deploying on the new server (see ). Also, you must have correct the class path for the version of JDBC you use.

This chapter includes the following sections:



NAS 2.1 Application Components

This section describes the iPlanet Application Server 6.5 support for each of the major types of components from the 2.1 programming model. This support is outlined in the following sections:


HTML Templates

For presentation layout, NAS 2.1-style HTML Templates, including GX tags, are fully supported without alteration by the NAS template engine. If a template is called by a servlet, however, it is compiled as a JSP. JSPs support GX tags with the exception of hierarchical queries.


AppLogics

The AppLogic framework is fully supported in iPlanet Application Server 6.5, though many of the proprietary APIs introduced in NAS 2.1 have been deprecated in favor of the Java standards on which the new programming model is based. For more information, see iPlanet Application Server Foundation Class Reference.


Database Logic: DAE and JDBC

The NAS 2.1 database access classes and interfaces are now deprecated in favor of JDBC, the Java standard database connectivity API. Code that uses NAS 2.1 database connection and query methods is supported in iPlanet Application Server 6.5, but this support may disappear in a future release.

The new JDBC layer provides the same functionality as the old 2.1 JDBC layer and many new methods are supported. As a result, you may want to modify some of your Applogic code to remove workarounds or add new JDBC calls.

AppLogics should use either of the foillowing JDBC layers:

  • The new JDBC layer.

  • The old JDBC layer, but not both. Servlets and EJBs should use only the new JDBC layer. Mixing and matching of JDBC calls from each version is not supported.

You can use JDBC AppLogics from NAS 2.1 against the same iPlanet Application Server 6.5 JDBC layer, but you must make sure that the JDBC 2.0 interfaces are loaded into the JVM instead of the 1.2 interfaces. For example, if you get a log message like the following, you probably have the JDBC 1.2 interfaces in your CLASSPATH before the JDBC 2.0 interfaces:

[01/05/99 11:25:51:0] error: APPLOGIC-caught_exception: Caught Exception:
java.lang.NoSuchMethodError: java.sql.Statement: method
addBatch(Ljava/lang/String;)V not found


NAS Registry

Part of the NAS registry now resides in an LDAP directory, though for the most part access to it has not changed. For more information, see the Administration & Deployment Guide.



Deploying NAS 2.1 Applications



Use the iPlanet Application Server Administrator Tool to deploy all applications to iPlanet Application Server. For more information, see the Administration & Deployment Guide.



Java Extensions



To migrate Java NAS 2.1 extensions to iPlanet Application Server 6.5, perform the following steps:

  1. Load IDL code in iPlanet Extension Builder 6.5 and create new generated code.

  2. Merge any changes which have been made to the previous extensions into the new generated code.

  3. Convert any references to NMI to JNI (if applicable).

  4. Perform all other Java code changes for JDK 1.3.1.

  5. Recompile all code.



C++ Applications and Extensions

iPlanet Application Server 6.5 provides new versions of required C++ header files. For this reason, C++ applications and extensions must be recompiled using the new header files. Users must recompile and link their extensions against iPlanet Application Server 6.5 libraries.

iPlanet Application Server provides pre-built extensions for several legacy systems, including MQSeries, TUXEDO, and CICS. These extensions have been re-released to provide support for iPlanet Application Server 6.5, though they will retain support for the NAS 2.1 programming model.



Beginning the Migration Process



When you decide to migrate your application to the new model, it is easiest to begin by redesigning your application and coming up with a transition plan. It is often best to gradually migrate parts of an application to a new programming model, rather than planning a large-scale migration for the entire application. However, it is also possible to migrate gradually by programming tier (presentation layout, business logic, and so on) rather than by application component.

For information on partial migration, including how to allow 2.1 components (like AppLogics) to interact with 6.5 components (like servlets and EJBs), see ."



Migrating the Sample Applicatons



This section describes how you can migrate the following example applications:


Online Bank Example

This example is divided into the following sections:


Migration From NAS 2.1 to iPlanet Application Server 6.5 - Solaris Only

iPlanet Application Server 6.5 includes JDK 1.3.1_02 as part of its distribution. With the new JDK1.2, all the java core packages like java.io, java.lang, and so on, are packaged into rt.jar instead of the classes.zip as in JDK 1.1. You can find rt.jar in the following location:

/iAS6.5-install-directory/ias/usr/java/jre/lib

If you want to compile any java classes you have to have rt.jar in the CLASSPATH and you should use the javac, located in the /iAS6.5-install-directory/ias/usr/java/bin directory, for compilation.

To migrate from NAS 2.1 to iPlanet Application Server 6.5 (Solaris platforms), perform the following steps:

  1. Copy the OnlineBank java Application package to the machine where iPlanet Application Server 6.5 has been successfully installed by creating a new directory OnlineBank under GXAPP.

    /iAS6.5-install-directory/ias/APPS/GXApp/OnlineBank

  2. Create a new directory called OnlineBank under docs/GXApp in the webserver installation directory.

    /Netscape/Suitespot/docs/GXApp/OnlineBank

    Then copy all the HTML files of OnlineBank in NAB 2.1 webserver docs directory into the OnlineBank directory.

  3. Create an entry for ksample in the tnsnames.ora. Make sure ksample points to the Oracle database running 8.1.7.

  4. Register using kreg utility.

    Change directory to /iAS6.5-install-directory/ias/APPS/GXApp/OnlineBank then run /iAS6.5-install-directory/ias/bin/kreg OnlineBank.gxr.

    Make sure that you are running the iPlanet Application Server 6.5 kreg and not the old 2.1 version.

  5. Run the sample application http://hostname/GXApp/OnlineBank/OBLogin.html, and then go further to see the account balance and other options.


C++ COnlineBank (NAS2.1) Sample Application

To run the C++ COnlineBank (NAS2.1) Sample Application, perform the following steps:

  1. Copy the COnlineBank Application to the machine where iPlanet Application Server 6.5 has been successfully installed by creating a new directory COnlineBank under GXApp /iAS6.5-install-directory/ias/APPS/GXApp/COnlineBank.

  2. Create a new directory called COnlineBank under docs/GXApp in the webserver installation directory: /Netscape/Suitespot/docs/GXApp/COnlineBank, and copy all the HTML files of COnlineBank in NAB 2.1 webserver docs directory into the above created COnlineBank directory.

  3. Set the following two environment variables:

    setenv GX_ROOTDIR /iAS6.5-install-directory/ias

    setenv GX_ROOT /iAS6.5-install-directory/ias

  4. Create an entry for ksample in the tnsnames.ora. Make sure ksample points to the Oracle Database running 8.1.7.

  5. Run make with the supplied makefile: /usr/ccs/bin/make -f makefile (Where /usr/ccs/bin is the directory where the make file exists). This action copies the generated libCOnlineBank.so file into the /iAS6.5-install-directory/ias/gxlib directory.

  6. Register using kreg utility.

    Change the directory to /iAS6.5-install-directory/ias/APPS/GXApp/COnlineBank then run /iAS6.5-install-directory/ias/bin/kreg COnlineBank.gxr.

    Make sure that you are running the new iPlanet Application Server 6.5 kreg and not the old NAS 2.1 version.

  7. Run the sample application http://hostname/GXApp/COnlineBank/COBLogin.html and check the account balance and other options.


US Population Java Sample Application

To migrate the US Population Java example from NAS 2.1 to iPlanet Application Server 6.5, perform the following steps:

  1. Copy the US Population java application package to a new directory called States on the machine where iPlanet Application Server 6.5 has been successfully installed (for example: GXAPP/IAS6.5-install-directory/ias/APPS/GXApp/States).

  2. Create a new directory called States under docs/GXApp in the webserver installation directory:

    /Netscape/Suitespot/docs/GXApp/States

    Then, copy all the HTML files from the US Population application in NAB 2.1 webserver docs directory into the above named States directory.

  3. Create an entry for ksample in the tnsnames.ora. Make sure ksample points to the Oracle DataBase version 8.1.7.

  4. Register using kreg utility.

    Then change the directory to /IAS6.5-install-directory/ias/APPS/GXApp/States, and then run /IAS6.5-install-directory/ias/bin/kreg states.gxr.

    Make sure that you are running theiPlanet Application Server 6.5 kreg and not the old 2.1 version.

  5. Run the US Population application:

    http://hostname/GXApp/States/index.html

    Then click on RunRegionReport to see the population statistics.


US Population C++ Sample Application

To migrate the US Population C++ example from NAS 2.1 to iPlanet Application Server 6.5, perform the following steps:

  1. Copy the US Population C++ application to the machine where iPlanet Application Server 6.5 has been successfully installed. Copy it to a new directory called CStates under GXAPP (for example: /IAS6.5-install-directory/ias/APPS/GXApp/CStates).

  2. Create a new directory called CStates under docs/GXApp in the webserver installation directory:

    /Netscape/Suitespot/docs/GXApp/CStates.

    Then copy all the HTML files of US Population in NAB 2.1 webserver documents directory into the above created CStates directory.

  3. Create an entry for ksample in the tnsnames.ora. Make sure ksample points to the Oracle DataBase version 8.1.7.

  4. Run nmake on the states.mak file (make -f states.mak).

  5. Copy the generated states.dll to /IAS6.5-install-directory/ias/bin directory.

  6. Register using kreg utility.

    Then change directory to /IAS6.5-install-directory/ias/APPS/GXApp/CStates, and run /IAS6.5-install-directory/ias/bin/kreg states.gxr.

    Make sure that you are running the iPlanet Application Server 6.5 kreg and not the older 2.1 version.

  7. Run the US Population application:

    http://hostname/GXApp/CStates/index.html

    Then click on RunRegionReport to see the population statistics.


Previous     Contents     Index     Next     
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.

Last Updated March 06, 2002