Name space dump utility for java:, local: and server name spaces

Sometimes it is helpful to dump the java: name space for a J2EE application. We cannot use the dumpNameSpace command line utility for this purpose because the application's java: name space is accessible only by that J2EE application. From the WAS scripting tool, one can invoke a NameServer MBean to dump the java: name space for any J2EE application running in that same server process.

There is another name space local to server process which one cannot dump with the dumpNameSpace command line utility. This name space has the URL scheme of local: and is used by the container to bind objects locally instead of through the name server. The local: name space contains references to enterprise beans with local interfaces. There is only one local: name space in a server process. We can dump the local: name space by invoking the NameServer MBean associated with that server process.

 

Name space dump options

Name space dump options are specified in the MBean invocation as a parameter in character string format. The option descriptions follow.

-startAt some/subcontext/in/the/tree

Indicates the path from the name space 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 root context.

-report {short | long}

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).

-root {tree | host | legacy | cell | node | server | default}

Specify the root context of where the dump should start. The default value for -root is cell. This option is only valid for server name space dumps.

Option Description
tree Dump the tree starting at the tree root context.
host Dump the tree starting at the server host root context (synonymous with "node").
legacy Dump the tree starting at the legacy root context.
cell Dump the tree starting at the cell root context. This is the default option.
node Dump the tree starting at the node root context (synonymous with "host").
server Dump the tree starting at the server root context. This is -root default.
default Dump the tree starting at the initial context which JNDI returns by default for that server type.

-format {jndi | ins}

Specify the format to display name component as atomic strings or parsed according to INS rules (id.kind). This option is only valid for server name space dumps.

Option Description
jndi Display name components as atomic strings. This is -format default.
ins Display name components parsed according to INS rules (id.kind).

 

NameServer MBean invocation

  1. Enter the WAS scripting command prompt.

    Invoke a method on a NameServer MBean by using the WAS scripting tool. Enter the scripting command prompt by typing the following command:

    Platform Command
    UNIX wsadmin.sh
    Windows NT wsadmin

    Use the -help option for help on using the wsadmin command.

  2. Select the NameServer MBean instance to invoke.

    Execute the following script commands to select the NameServer instance you want to invoke. For example,

    set mbean [$AdminControl completeObjectName WebSphere:*,type=NameServer,cell=
        cellName,node=nodeName,process=serverName]
    
    where cellName, nodeName, and serverName are the names of the cell, node, and server for the MBean you want to invoke. The specified server must be running before you can invoke a method on the MBean.

    We can see a list of all NameServer MBeans current running by issuing the following query

    $AdminControl queryNames {*:*,type=NameServer}
    

  3. Invoke the NameServer MBean.

    java: name space

    Dump a java: name space by invoking the dumpJavaNameSpace method on the NameServer MBean. Since each server application has its own java: name space, the application must be specified on the method invocation. An application is identified by the application name, module name, and component name. The method syntax follows

    $AdminControl invoke $mbean dumpJavaNameSpace {{appname}{modName}{compName}{opts}}
    

    where appName is the application name, modName is the module name, and compName is the component name of the java: name space you want to dump. The value for opts is the list of name space dump options described earlier in this section. The list can be empty.

    local: name space

    Dump a java: name space by invoking the dumpLocalNameSpace method on the NameServer MBean. Because there is only one local: name space in a server process, you have to specify the name space dump options only

    $AdminControl invoke $mbean dumpLocalNameSpace {{opts}}
    

    where opts is the list of name space dump options described earlier in this section. The list can be empty.

    Server name space

    Dump a server name space by invoking the dumpServerNameSpace method on an application server's NameServer MBean. This provides an alternative way to dump the name space on an application server, much like the dumpNameSpace command line utility

    $AdminControl invoke $mbean dumpServerNameSpace {{opts}}
    

    where opts is the list of name space dump options described earlier in this section. The list can be empty.

 

Name space dump output

Name space dump output is sent to the console. It is also written to the file DumpNameSpace.log, in the server's log directory.


 

Related Tasks


Troubleshooting name space problems

 

See Also


dumpNameSpace tool