This document describes special considerations to be taken into account when working with the Sun J2EE Developer's Guide samples on iPlanet.
It is recommended that you deploy and exercise the simple Currency Converter stateless session bean example prior to trying the other samples. Converter setup steps are documented in great detail whereas the other samples contain only highlights of the necessary deployment steps.
Modifications Made to the Sun Samples
The following modifications have been made to the Sun J2EE Developer's Guide samples.
Java Packages: The Sun J2EE Developer's Guide samples are not packaged in Java packages. To ensure that these samples do not conflict with other samples and customer applications deployed to iPlanet Application Server, the Sun samples have been placed under the package j2eeguide.<sample name>. For example, j2eeguide.converter is the package name used for the Converter sample.
RMI/IIOP Client Target Host and Port: The RMI/IIOP client applications in the Sun J2EE Developer's Guide samples do not specify a target host name and port number to enable access to a remote server. iPlanet has added support for specifying these values on the command line of each RMI/IIOP client application.
RMI/IIOP Client InitialContext and Remote EJB Lookup: The following code in the Sun samples was modified to represent the manner in which InitialContext is established and remote EJB lookups are performed in iPlanet Application Server.
Context initial = new InitialContext();This code was changed to:
Object objref = initial.lookup("MyBank");
Properties env = new Properties();
env.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
env.put("java.naming.provider.url", "iiop://" + host + ":"+port);Context initial = new InitialContext(env);
Object objref = initial.lookup("ejb/MyBank");
Refer to the iPlanet Application Server Developer's Guide section on RMI/IIOP for further details on performing JNDI lookups in RMI/IIOP-based client applications.
Sample-specific Modifications: If a sample contains modifications other than those listed above, the sample setup instructions describe the changes made by iPlanet. Since the Sun samples are focused on very specific EJB technologies, you may find that certain aspects of these samples that are not the focus of the sample do not represent approaches that would be used in production applications. For example, exception handling in the samples might not match what one would expect to implement in a production application. Unless there was a grossly more efficient or cleaner implementation of the focal point of a sample in iPlanet Application Server, iPlanet has not revised the samples.
It is recommended that you define a user named j2eeguide in your database so that you can easily administer the database tables created to support the J2EE Developer's guide samples. If you do not use a unique database user for these samples, you may find that some of the database table names used by the samples conflict with other tables in your database.
Ant-based build files are supplied with all of the samples. To rebuild an application, simply execute "build" under the src/ directory of the application. See the Sample Application Build Facility document for more details on using Ant in conjunction with the samples.
As an alternative means of exercising the EJBs in the Developer's Guide samples,
iPlanet has included simple servlets in each sample. The servlets mimic the
behaviour of the Java application clients.
The sample source code directory structure follows the same layout as used in the other iPlanet Application Server samples. See the Sample Application Packaging document for details.
A client application would typically reside in a Java package distinct from the EJB's Java package. For reasons of simplicity, the Converter sample bundles both the application client as well as the EJB classes under a common package named:
j2eeguide.converter
The original, unaltered Sun sample source code is located under the directory:
Copyright (c) 2001 Sun Microsystems, Inc. All rights reserved.install_dir/ias/ias-samples/j2eeguide/docs/sun-ejb-devguide/examples/