WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.jndi
Class InitialContextExample

java.lang.Object
  |
  +--examples.jndi.InitialContextExample

public class InitialContextExample
extends java.lang.Object

This example shows how to create a context with default (guest access) to the naming system, and how to create a context that has authenticated access to the naming system.

The following sections cover what to do:

  1. Build the Example
  2. Run the Example

Build the Example

  1. Set up your development shell, as described in Setting up your environment.

  2. Build the example by executing the build script provided for this example.

    The build.xml script is available in the SAMPLES_HOME\server\src\examples\jndi directory, where SAMPLES_HOME refers to the directory for all samples and examples for the WebLogic Platform.

    To build the example, move to the JNDI example directory and run the script using the following Java ant command:

    prompt> ant 

Run the Example

  1. Start the WebLogic Server in a new command shell.

  2. In your development shell, run the client with the following command:
    prompt> ant run_initialcontext 
    Parameters contained within the run script are:
    hostname
    Host name of the WebLogic Server.
    port
    Port where the WebLogic Server is listening for connections.

Author:
Copyright (c) 2002 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
InitialContextExample()
           
 
Method Summary
static void main(java.lang.String[] args)
          Runs this example from the command line.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialContextExample

public InitialContextExample()
Method Detail

main

public static void main(java.lang.String[] args)
Runs this example from the command line.

Documentation is available at
http://e-docs.bea.com/wls/docs70

Copyright © 2002 BEA Systems, Inc. All Rights Reserved.