JNDI namespace dump utility
The namespace stored by a given name server can be dumped with the name space dump utility. You can invoke this utility from the command line or from a Java program. The naming service for the WAS host must be active when this utility is invoked.
Product
The dumpNameSpace script is available in WAS and WAS Network Deployment.
Authority
To run the script, your user profile must have *ALLOBJ authority.
Usage
You can invoke the namespace dump utility in two ways.
- Invoke the name space dump utility by adding the following code to your Java program:
import com.ibm.websphere.naming.DumpNameSpace; java.io.PrintStream filePrintStream = ... Context ctx = new InitialContext(); Context ctx = (Context) ctx.lookup("<starting_context>"); // Starting context for dump DumpNameSpace dumpUtil = new DumpNameSpace(filePrintStream, DumpNameSpace.LONG); dumpUtil.generateReport(ctx);where <starting_context> is the starting context for the dump.
For more information, see JNDI implementation for the API documentation.
Invoke the namespace dump utility on your iSeries server by running the dumpNameSpace script from Qshell.
- Enter the Start Qshell (STRQSH) command on an OS/400 command line.
- At the Qshell command prompt, enter the following command:
cd /QIBM/ProdData/WebAS5/edition/binwhere edition is either Base or ND, depending on the edition of WAS you have installed.
- Run the dumpNameSpace script. The syntax is as follows:
dumpNameSpace -host myhost.mycompany.com -port <port_number>where <port_number> is the name service port which, if not specified, defaults to 2809. In this case, assume that the port number is 2809, as this is the default name service port for the default application server instance.
The keywords and associated values for the dumpNameSpace utility are:
Keyword Values Description -host Example: myhost.myserver. mycompany.com Represents the bootstrap host or the WAS host whose name space you want to dump. The value defaults to localhost. -port Example: nnn Represents the bootstrap port which, if not specified, defaults to 2809. -factory Example: com.ibm.websphere. naming.WsnInitial ContextFactory Indicates the initial context factory to be used to get the JNDI initial context. The value defaults to com.ibm.websphere.naming.WsnInitialContextFactory. You typically do not need to change the default value. -root cell
server
node
legacy
host
tree
default
- The cell option dumps the tree starting at the cell root context and is the default value.
- The server option dumps the tree starting at the server root context.
- The node option dumps the tree starting at the node root context.
- In earlier versions of WAS, the legacy option dumps the tree starting at the legacy root context and is the default value.
- In earlier versions of WAS, the host option dumps the tree starting at the bootstrap host root context.
- In earlier versions of WAS, the tree option dumps the tree starting at the tree root context.
- The default option dumps the tree starting at the initial context that JNDI returns by default for that server type.
-url Example: some_url Represents the value for the java.naming.provider.url property, which is used to get the initial JNDI context. -startAt Example: 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, which represents context of the bootstrap host root. -format jndi
ins
Displays name components as atomic strings. (Note: This is the default value.) Displays name components parsed per INS rules (id.kind).
-report short
long
Dumps the binding name and bound object type. This output is also provided by JNDI Context.list(). (Note: This is the default value.) 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).
-traceString Example: "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 the file DumpNameSpaceTrace.out in the current working directory. -help Provides a description of Name Space Dump utility and command line usage. See Example: Output from the namespace dump utility for sample output.