The namespace stored by a given name server can be dumped with the name space dump utility that is shipped with WebSphere Application Server - Express. You can invoke this utility from the command line or from a Java program. The naming service for the WebSphere Application Server - Express host must be active when this utility is invoked.
You can invoke the namespace dump utility in these ways:
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.
cd /QIBM/ProdData/WebASE51/ASE/bin
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.
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 WebSphere Application Server - Express 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.
WsnInitialContextFactory |
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 |
|
-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.