iPlanet Application Server Migration Guide



Chapter 2   Running NAS 2.1 Applications on iAS 6.0


This chapter describes how to run NAS 2.1 applications on iAS 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 iAS 6.0. The Bank example will help you walk through a step by step migration.

iAS 6.0 is completely backward-compatible with NAS 2.1. In other words, you should be able to deploy your older NAS 2.1 application on iAS 6.0 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.



NAS 2.1 Application Components



This section describes the iAS 6.0 support for each of the major types of components from the 2.1 programming model.


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 iAS 6.0, 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 iAS 6.0, 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

  • The new JDBC layer

    or

  • 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 iAS 6.0 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


The NAS Registry

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



Deploying NAS 2.1 Applications on iAS 6.0



Use the iAS Administrator Tool (iASAT) to deploy all applications to iAS. For more information, see the Administration & Deployment Guide.



C++ Applications and Extensions



iAS 6.0 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 iAS 6.0 libraries.

iAS provides pre-built extensions for several legacy systems, including MQSeries, TUXEDO, and CICS. These extensions will be re-released to provide support for iAS 6.0, though they will retain support for the NAS 2.1 programming model.



Java Extensions



Migration of Java NAS 2.1 extensions to iAS 6.0 is as follows:

  1. Load IDL code in iPlanet Extension Builder 6.0 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.2.2

  5. Recompile all code



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, etc.) rather than by application component.

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



Online Bank Example




Migration From NAS 2.1 to iAS 6.0 - Solaris Only
NOTE: iAS 6.0 will have JDK 1.2.2 as part of its distribution. With the new JDK1.2 all the java core packages like java.io and java.lang etc. are packaged into rt.jar instead of the classes.zip as in JDK 1.1. you can find rt.jar in /iAS6.0-install-directory/nas/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 which is there in /iAS6.0-install-directory/nas/usr/java/bin directory for compilation

Step 1: Copy the OnlineBank java Application package to the machine where iAS 6.0 has been successfully installed by creating a new directory OnlineBank under GXAPP

/iAS6.0-install-directory/nas/APPS/GXApp/OnlineBank

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

/Netscape/Suitespot/docs/GXApp/OnlineBank

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

Step 3: Create an entry for 'ksample' in the tnsnames.ora. Make sure 'ksample' points to the Oracle database running 8.0.5

Step 4: Register using kreg utility

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

* Make sure that you are running the iAS 6.0 kreg and not the old 2.1 version.

Step 5: Run the sample application http://hostname/GXApp/OnlineBank/OBLogin.html

and go further to see the account balance and other options.


C++ COnlineBank(NAS2.1) Sample Application
Step 1: Copy the COnlineBank Application to the machine where iAS 6.0 has been successfully installed by creating a new directory COnlineBank under GXApp
/iAS6.0-install-directory/nas/APPS/GXApp/COnlineBank

Step 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

Step 3: Set the following two environment variables.
setenv GX_ROOTDIR /iAS6.0-install-directory/nas
setenv GX_ROOT /iAS6.0-install-directory/nas

Step 4: Create an entry for 'ksample' in the tnsnames.ora. Make sure 'ksample' points to the Oracle Database running 8.0.5

Step 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). It will copy the generated libCOnlineBank.so file into the /iAS6.0-install-directory/nas/gxlib directory.

Step 6: Register using kreg utility.

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

* Make sure that you are running the new iAS 6.0 kreg and not the old NAS 2.1 version.

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



US Population C++ Sample Application




Migrating from NAS 2.1 to iAS 6.0
Step 1: Copy the US Population C++ application to the machine where IAS 6.0 has been successfully installed. Copy it to a new directory called CStates under GXAPP .e.g. /IAS6.0-install-directory/nas/APPS/GXApp/CStates

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

/Netscape/Suitespot/docs/GXApp/CStates

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

Step 3: Create an entry for 'ksample' in the tnsnames.ora. Make sure 'ksample' points to the Oracle DataBase version 8.0.5

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

Step 5: Copy the generated states.dll to /IAS6.0-install-directory/nas/bin directory

Step 6: Register using kreg utility

Change directory to /IAS6.0-install-directory/nas/APPS/GXApp/CStates then run /IAS6.0-install-directory/nas/bin/kreg states.gxr

* Make sure that you are running the IAS6.0 kreg and not the older 2.1 version.

Step 7: Run the US Population application

http://hostname/GXApp/CStates/index.html. Click on RunRegionReport to see the population statistics



US Population Java Sample Application



Migrating from NAS 2.1 to iAS 6.0

Step 1: Copy the US Population java application package to a new directory called States on the machine where iAS 6.0 has been successfully installed. .e.g GXAPP/IAS6.0-install-directory/nas/APPS/GXApp/States

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

/Netscape/Suitespot/docs/GXApp/States

and Copy all the HTML files from the US Population application in NAB 2.1 webserver docs directory into the above named States directory.

Step 3: Create an entry for 'ksample' in the tnsnames.ora. Make sure 'ksample' points to the Oracle DataBase version 8.0.5

Step 4: Register using kreg utility

Change the directory to /IAS6.0-install-directory/nas/APPS/GXApp/States and then run /IAS6.0-install-directory/nas/bin/kreg states.gxr

* Make sure that you are running the IAS6.0 kreg and not the old 2.1 version.

Step 5: Run the US Population application
http://hostname/GXApp/States/index.html click on RunRegionReport to see the population statistics






Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.

Last Updated April 25, 2000