BEA Systems Logo Banner Arc  
  WebLogic Enterprise 5.0 EJB Sample Applications


WebLogic Enterprise 5.0 EJB Sample Applications

Welcome to the EJB Sample Applications page. WebLogic Enterprise (WLE) provides the following sample applications. Click on a link to get a complete description of the sample, along with instructions on how to build and run the sample.

EJB Samples Javadoc

Javadoc for the EJB samples are available from the following links:

Building and Running the EJB Sample Applications

This section contains the following topics:

General Information

Note the following about building and running the samples:

Setting the Environment Variables

Before running the build script/batch file, the following system environment variables need to be set:

Variable Description

TUXDIR

The directory path where you installed the Iced Java software. For example:

Windows NT:

TUXDIR=c:\wledir

UNIX

TUXDIR=/usr/local/wledir

JAVA_HOME

The directory path where you installed the JDK software. For example:

Windows NT

JAVA_HOME =c:\JDK1.2

UNIX

JAVA_HOME =/usr/local/JDK1.2

The following system environment variables, other than those beginning with DB_, may optionally be set prior to running the build command to change their default value. See the WLE Administration Guide for more information about selecting appropriate values for these environment variables.

Variable Description

HOST

The host name portion of the TCP/IP network address used by the ISL process to accept connections from Java clients. The default value is the name of the local machine.

PORT

The TCP port number at which the ISL process listens for incoming requests; it must be a number between 0 and 65535. The default value is 2468.

IPCKEY

The address of shared memory; it must be a number greater than 32769 unique to this application on this system. The default value is 55432.

DB_INSTANCE

Name of the database instance or server. The default value for Oracle is Beq-Local. This is needed only for the samples that use a database.

DB_USER

Name of the database user. The default is scott. This is needed only for the samples that use a database.

DB_PASSWORD

Password for the database user. The default is tiger. This is needed only for the samples that use a database.

DB_DRIVER

The Java class name of the database driver. Default is Oracle 8i driver, weblogic.jdbc20.oci815.Driver.This is needed only for the samples that use a database.

DB_URL

Database connection URL. The default for Oracle is jdbc:weblogic.oracle.Beq-Local. This is needed only for the samples that use a database.

Building the EJB Sample Applications

Use the following steps to build the EJB samples.

  1. Make sure that the directory in which you installed WLE is set in the environment variable TUXDIR. Make sure to set the JAVA_HOME environment variable.

    Note: For details about setting the TUXDIR and JAVA_HOME environment variables, see the WebLogic Enterprise Installation Guide.

  2. Make a copy of the $TUXDIR\samples\j2ee\ejb directory into a working directory.

  3. Change directory to the working directory. If you're on a UNIX system, start a Korn shell.

  4. Change the permissions on all the files to give them write-access.

    Windows NT

    prompt>attrib /S -r *

    Unix

    prompt>chmod -R +w *

    For UNIX systems, change the permission of the runme.ksh file to give it execute permission, as in the following command:

    prompt>chmod +x runme.ksh

  5. Run the JavaServer version of the sample automatically by entering the runme command:

    Windows NT:

    prompt>runme <category_name> <sample_directory>

    UNIX:

    prompt>. ./runme.ksh <category_name> <sample_directory>

    In the preceding commands, category_name represents one of the following EJB sample application categories:

  6. A number of messages are displayed, along with whether or not the build procedure was successful. Note that the sample is not only built, but also the servers are booted and the client is run once.

After you have executed the runme command, you can run the sample manually if you like.

To run the samples manually:

  1. Change the current directory to the desired sample's directory.

  2. Make sure that your environment is set correctly by entering the following command:

    Windows NT:

    prompt>setenv

    UNIX:

    prompt>. ./setenv.ksh

  3. Boot the server, run the client, and shut down the server by entering the following commands:

    Windows NT

    prompt>tmboot -y
    prompt>run_client.cmd
    prompt>tmshutdown -y

    UNIX:

    prompt>tmboot -y
    prompt>. ./run_client.sh
    prompt>tmshutdown -y

To restore the sample application directory to its original state:

  1. Set the directory to the directory containing the sample application.

  2. Enter the following command:

    Windows NT:

    prompt>%TUXDIR%\samples\j2ee\ejb\clean.cmd

    UNIX:

    prompt>. ./$TUXDIR/samples/j2ee/ejb/clean.ksh

EJB Sample Server Application Processes

When the you enter the tmboot command to start one of the EJB sample application, the following server processes are started:

 
 
    BEA Home | Corporate Info | News | Solutions | Products | Partners | Services | Events | Download | How to Buy
 Copyright © 1999, BEA Systems, Inc. All rights reserved.
 Contact BEAdocsupport@beasys.com