InfoCenter Home >
4: Developing applications >
4.6: Java Technologies >
4.6.2: JNDI (Java Naming and Directory Interface) overview >
4.6.2.4: JNDI helpers and utilities >
4.6.2.4.2: JNDI Name Space Dump utility

4.6.2.4.2: JNDI Name Space Dump utility

The name space stored by a given name server can be dumped with the name space dump utility that is shipped with WebSphere Application Server. This utility can be invoked from the command line or from a Java program. The naming service for the WebSphere Application Server host must be active when this utility is invoked.

To invoke this utility using the class com.ibm.websphere.naming.DumpNameSpace API, see the API documentation.

To invoke the utility through the command line, enter the following command from the AppServer/bin directory:

    UNIX:   dumpNameSpace.sh [[-keyword value]...]
    Windows NT:   dumpNameSpace [[-keyword value]...]

The keywords and associated values for the dumpNameSpace utility are:

-host myhost.austin.ibm.com

Represents the bootstrap host or the WebSphere Application Server host whose name space you want to dump. The value defaults to localhost.
-port nnn
Represents the bootstrap port which, if not specified, defaults to 900.
-factory com.ibm.websphere.naming.WsnInitialContextFactory
Indicates the initial context factory to be used to get the JNDI initial context. The value defaults to:
com.ibm.websphere.naming.WsnInitialContextFactory
The default value generally does not need to be changed.
-startAt some/subcontext/in/the/tree
Indicates the path from the bootstrap host's root context to the top level context where the dump should begin. The utility recursively dumps subcontexts below this point. It defaults to an empty string, that is, the bootstrap host root context.
-format {jndi | ins}

    jndi   Displays name components as atomic strings.

  The default format is jndi.
    ins   Displays name components parsed per INS rules (id.kind).
-report {short | long}

      short   Dumps the binding name and bound object type. This output is also provided by JNDI Context.list().

  The default report option is short.
      long   Dumps the binding name, bound object type, local object type, and string representation of the local object (that is, the IORs, string values, and other values that are printed).

For objects of user-defined classes to display correctly with the long report option, it may be necessary to add their containing directories to the list of directories searched. This can be done by setting the environment variable WAS_USER_DIRS. The value can include one or more directories, as for example:

    UNIX:  
WAS_USER_DIRS=/usr/classdir1:/usr/classdir2
export WAS_USER_DIRS
    Windows NT:  
set WAS_USER_DIRS=c:\classdir1;d:\classdir2

All zip, jar, and class files in the specified directories can then be resolved by the class loader when running dumpNameSpace

-traceString "some.package.name.to.trace.*=all=enabled"
Represents the trace string with the same format as that generated by the servers. The output is sent to file, DumpNameSpaceTrace.out.
-help
Provides a description of Name Space Dump utility and command line usage.

Examples of Name Space Dump utility usage and output


  • Invoke the name space dump utility by adding the following code to your Java program:
    {
    [...]
    java.io.PrintStream filePrintStream = ...
    Context ctx = new InitialContext();
    ctx = (Context) ctx.lookup("ejsadmin/node");   // Starting context for dump
    DumpNameSpace dumpUtil = new DumpNameSpace(filePrintStream, DumpNameSpace.SHORT);
    dumpUtil.generateDump(ctx);
    [...]
    }
    
  • Invoke the name space dump utility from the command line by entering the following command:
    dumpNameSpace -host myhost.mycompany.com -port 901
    
  • The generated output will look like the following example, which is the SHORT dump format:

    Getting the initial context
    Getting the starting context
    
    ====================================================================================
    Name Space Dump
    Provider URL: iiop://will:901
    Context factory: com.ibm.websphere.naming.WsnInitialContextFactory
    Starting context: (top)=bootstrap host root context
    Formatting rules: jndi
    Time of dump: Fri Mar 09 15:11:48 CST 2001
    ====================================================================================
    
    
    ====================================================================================
    Beginning of Name Space Dump
    ====================================================================================
    
    1 (top)
    2 (top)/jta                                          javax.naming.Context
    3 (top)/jta/usertransaction                          com.ibm.ejs.jts.jta.UserTransactionImpl
    4 (top)/SecurityCurrent                              com.ibm.ejs.security.util.SecurityCurrentRef
    5 (top)/ContextHome                                  com.ibm.ejs.ns.CosNaming.EJSRemoteContextHome
    6 (top)/PropertyHome                                 com.ibm.ejs.ns.CosNaming.EJSRemotePropertyHome
    7 (top)/BindingHome                                  com.ibm.ejs.ns.CosNaming.EJSRemoteBindingHome
    8 (top)/will                                         javax.naming.Context
    9 (top)/will/resources                               javax.naming.Context
    10 (top)/will/resources/sec                           javax.naming.Context
    11 (top)/will/resources/sec/SecurityServer            com.ibm.WebSphereSecurityImpl.SecurityServerImpl
    12 (top)/ejsadmin                                     javax.naming.Context
    13 (top)/ejsadmin/node                                javax.naming.Context
    14 (top)/ejsadmin/node/will                           javax.naming.Context
    15 (top)/ejsadmin/node/will/homes                     javax.naming.Context
    16 (top)/ejsadmin/node/will/homes/DeployEJBHome       com.ibm.ejs.sm.tasks.EJSRemoteDeployEJBHome
    17 (top)/ejsadmin/node/will/homes/ServletEngineHome   com.ibm.ejs.sm.beans.EJSRemoteServletEngineHome
    
    [etc.]
    
    ====================================================================================
    End of Name Space Dump
    ====================================================================================
    

Go to previous article: JNDI helper class Go to next article: Java Message Service (JMS) overview

 

 
Go to previous article: JNDI helper class Go to next article: Java Message Service (JMS) overview