Example: Invoking the name space dump tool

It is often helpful to view a dump of the name space to understand why a naming operation is failing. We can invoke the name space dump tool from the command line or from a program. Examples of each option follow.

 

Invoking the name space dump tool from a command line

Invoke

the name space dump tool from a command line by entering either of the following commands

dumpNameSpace -host myhost.mycompany.com -port 901

or

dumpNameSpace -url corbaloc:iiop:myhost.mycompany.com:901

There are several command-line options to choose from. For detailed help on the options, enter either of the following commands

dumpNameSpace -help
or

dumpNameSpace -?

 

Invoking the name space dump tool from a Java program

You can dump name spaces from a program with the com.ibm.websphere.naming.DumpNameSpace API. Refer to the WAS API documentation for details on the DumpNameSpace program interface.

The following example illustrates how to invoke the name space dump tool from a Java program:

{
   ...
   import javax.naming.Context;
   import javax.naming.InitialContext;
   import com.ibm.websphere.naming.DumpNameSpace;
   ...
   java.io.PrintStream filePrintStream = ...
   Context ctx = new InitialContext();
   // Starting context for dump
   ctx = (Context) ctx.lookup("cell/nodes/node1/servers/server1");
   DumpNameSpace dumpUtil =
      new DumpNameSpace(filePrintStream, DumpNameSpace.SHORT);
   dumpUtil.generateDump(ctx);
   ...
}


 

Related Tasks


Troubleshooting name space problems

 

See Also


dumpNameSpace tool