dumpNameSpace tool
We can use the dumpNameSpace tool to dump the contents of a namespace accessed through a name server. The dumpNameSpace tool is based on Java Naming and Directory Interface (JNDI).
When you run the dumpNameSpace tool, the naming service must be active. The dumpNameSpace tool cannot dump namespaces local to the server process, such as those with java: and local: URL schemes. The local: namespace contains references to enterprise beans with local interfaces. Use the namespace dump utility for java:, local: and server namespaces to dump java: and local: namespaces.
The tool dumps the server root context for the server at the specified host and port unless specified a non-default starting context which precludes it. The tool does not dump the server root contexts for other servers.
Avoid trouble: If the system has more than one IP address, we need to modify the order in which the system configured name lookup mechanism processes during the running of the dumpNameSpace tool. You need to use the-Dsun.net.spi.nameservice.provider.1=dns,sun setting, a Java option, to ensure that the dumpNameSpace tool works successfully on systems which have more than one IP address.gotcha
Running dumpNameSpace
We can run the tool from a command line or using its program interface.
To access the dumpNameSpace tool through its program interface, refer to the class com.ibm.websphere.naming.DumpNameSpace in the WAS API documentation.
To run the tool from a command line, enter the dumpNameSpace command from the app_server_root/bin directory.
dumpNameSpace.sh [[-keyword value]...]
dumpNameSpace [[-keyword value]...]
If you run the dumpNameSpace tool with security enabled and the com.ibm.CORBA.loginSource property is set in the profile_root/properties/sas.client.props file, a login prompt is displayed.
If we cancel the login prompt, the dumpNameSpace tool continues outbound with an "UNAUTHENTICATED" credential. Thus, by default, an "UNAUTHENTICATED" credential is used that is equivalent to the "Everyone" access authorization policy. We can modify this default setting by changing the value for the com.ibm.CSI.performClientAuthenticationRequired property to true in the app_server_root/properties/sas.client.props file.
If we do not set the com.ibm.CORBA.loginSource property in the sas.client.props file, the dumpNameSpace tool continues outbound with the user name and password set in the credential.
If Kerberos (KRB5) is enabled for administrative authentication, the authenticationTarget supports both BasicAuth and KRB5. To use Kerberos authentication, you must update the sas.client.props, soap.client.props, and ipc.client.props files according to the connector type. When using Kerberos authentication, the user password does not flow across the wire. A one-way hash of the password identifies the client.
Parameters
The keywords and associated values for the dumpNameSpace tool follow:
- -host myhost.company.com
- Indicates the bootstrap host or the WAS host whose namespace to dump. The value defaults to localhost. Specify a value for -host if the tool is not run from the local machine. The -host parameter instructs the tool to connect to a server on a remote machine. For example, run
dumpNameSpace -host myhost.mycompany.com
to display the namespace of the server running on myhost.mycompany.com.
- -port nnn
- Indicates the bootstrap port which, if not specified, defaults to 2809.
- -root { cell | server | node | host | legacy | tree | default }
- Indicates the root context to use as the initial context for the dump. The applicable root options and default root context depend on the type of name server from which the dump is being obtained. Descriptions of -root options follow.
For WebSphere Application Server servers:
for product servers. The root context provides the initial
-root option Description cell DumpNameSpace default for product Version 5.0 or later servers. Dumps the tree starting at the cell root context. server Dumps the tree starting at the server root context. node Dumps the tree starting at the node root context. tree Dumps the tree starting at the tree root context. applications Dumps the tree starting at the applications root context. For all WebSphere Application Server and other name servers:
option description for product and non-product servers. The
-root option Description default Dumps the tree starting at the initial context which JNDI returns by default for that server type. This is the only -root option that is compatible with non-product name servers.
- -url some_provider_URL
- Indicates the value for the java.naming.provider.url property used to get the initial JNDI context. This option can be used in place of the -host, -port, and -root options. If the -url option is specified, the -host, -port, and -root options are ignored.
- -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 tool recursively dumps subcontexts beneath this point. It defaults to an empty string, that is, the bootstrap host root context.
- -format { jndi | ins }
-format option Description jndi The default. Displays name components as atomic strings. ins Shows name components parsed using Interoperable Naming Service (INS) rules (id.kind).
- -report { short | long }
-report option Description short The default. Dumps the binding name and bound object type. This output is also provided by JNDI Context.list(). 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, we might need to add their containing directories to the list of directories searched. Set the environment variable WAS_USER_DIRS at a command line. The value can include one or more directories.
WAS_USER_DIRS=/usr/classdir1:/usr/classdir2 export WAS_USER_DIRS
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 the dumpNameSpace tool.
- -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 the file DumpNameSpaceTrace.out.
Return codes
The dumpNameSpace tool has the following return codes:
of 0 indicates no error. Return codes of 1 through 3 indicate an error
Return code Description 0 Normal system exit. No error resulted from running dumpNameSpace. 1 Error in getting the starting context 2 Other error occurred with exception. Running dumpNameSpace resulted in an error other than an error in getting the starting context. 3 Unsupported option specified
Related tasks
View a namespace dump View java:, local:, and server namespace dumps Select an authentication mechanism Kerberos (KRB5) authentication mechanism support for security Troubleshooting namespace problems Reference topic