WebLogic Server 6.1 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. Compile the example by executing an ant build script or a command:
    1. An ant build script is available in the samples/examples/jndi directory. Enter the following command to execute the build script:

      ant
    2. Enter the following command to compile the InitialContextExample example:

       $ javac -d %CLIENT_CLASSES% InitialContextExample.java

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:
    $ java examples.jndi.InitialContextExample t3://hostname:port
    where:
    hostname
    Host name of the WebLogic Server.
    port
    Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort)

Author:
Copyright (c) 2001 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/docs61

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