Invoke the NameServer MBean to dump java:, local:, and server name spaces

It may be helpful to dump the java: name space for a J2EE application. You 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 WebSphere Application Server scripting tool, you 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 you 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. You can dump the local: name space by invoking the NameServer MBean associated with that server process.

To invoke the NameServer MBean:

  1. Start the wsadmin tool.
  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.

    You 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. Since 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.

Examples: Invoking the name space dump utility for java: and local: name spaces

It is often helpful to view the dump of a java: or local: name space to understand why a naming operation is failing. The NameServer MBean running in the application's server process can be invoked from the WebSphere Application Server scripting tool to generate a dump of these name spaces. Examples of NameServer MBean calls to generate dumps of java: and local: name spaces follow.

Dumping a java: name space

Assume you want to dump the java: name space of an application component running in server server1 on node node1 of the cell MyCell. The application name is AcctApp in module AcctApp.war, and the component name is Acct Servlet. The following script commands generate a long format dump of the application's java: name space of that application:

set mbean [$AdminControl completeObjectName 
WebSphere:*,type=NameServer,cell=MyCell,node=node1,process=server1]
$AdminControl invoke $mbean dumpJavaNameSpace {{AcctApp}{AcctApp.war}{Acct Servlet}{-report 
long}}

Dumping a local: name space

Assume you want to dump the local: name space for the server server1 on node node1 of cell MyCell. The following script commands will generate a short format dump of that server's local name space:

set mbean [$AdminControl completeObjectName 
WebSphere:*type=NameServer,cell=MyCell,node=node1,process=server1]
$AdminControl invoke $mbean dumpLocalNameSpace {{-report short}}