To understand why a naming operation is failing, you can
view the dump of a java: or local: namespace.
From the WebSphere® Application Server scripting
tool, invoke a NameServer MBean to dump java: or local: namespaces.
Before you begin
Start the naming service.
If the namespaces that
you want to view are not local to the server process, use the dumpNameSpace tool.
About this task
You cannot use the dumpNameSpace tool to dump a java: or local: namespace
because the dumpNameSpace tool cannot access those namespaces.
The java: namespace
of a Java Platform, Enterprise Edition (Java EE)
application is accessible only by that application. You can invoke
a NameServer MBean to dump the java: namespace for
any Java EE application running in the same server process.
The local: namespace
contains references to enterprise beans with local interfaces. There
is only one local: namespace in a server process.
You can invoke the NameServer MBean associated with that server process
to dump the local: namespace.
Use the scripting
tool to invoke the NameServer MBean running in the application's server
process to generate dumps of java: , local:,
or server namespaces.
Procedure
- Invoke a method on a NameServer MBean by using the WebSphere Application Server scripting tool.
Enter the scripting command prompt by typing the following
command:
wsadmin
Use the -help option
for help on using the wsadmin command.
- Select the NameServer MBean instance to invoke.
Run 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}
- Invoke the NameServer MBean.
You can dump
a java: , local:, or server namespace.
For each of these, the value for opts is the list of namespace
dump options described in Namespace dump utility for java:, local: and server namespaces.
The list can be empty.
- java: namespace
- Dump a java: namespace by invoking the dumpJavaNameSpace
method on the NameServer MBean. Since each server application has
its own java: namespace, 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: namespace
you want to dump.
- local: namespace
- Dump a java: namespace by invoking the dumpLocalNameSpace
method on the NameServer MBean. Because there is only one local: namespace
in a server process, you have to specify the namespace dump options
only.
$AdminControl invoke $mbean dumpLocalNameSpace {{opts}}
- Server namespace
- Dump a server namespace by invoking the dumpServerNameSpace method
on an application server's NameServer MBean. This provides an alternative
way to dump the namespace on an application server, much like the
dumpNameSpace command line utility.
$AdminControl invoke $mbean dumpServerNameSpace {{opts}}
Results
Namespace dump output is sent to the console. It is also
written to the file DumpNameSpace.log in the
server's log directory.
Example
- Dumping a java: namespace
- Assume you want to dump the java: namespace
of an application component running in server server1 on node node1
of the cell MyCell. The following script commands generate a long
format dump of the application's java: namespace
for DefaultApplication:
set mbean [$AdminControl completeObjectName WebSphere:*,type=NameServer,cell=MyCell,node=node1,process=server1]
$AdminControl invoke $mbean dumpJavaNameSpace {{DefaultApplication}{Increment.jar}{Increment}{-report long}}
- Dumping a local: namespace
- Assume you want to dump the local: namespace
for the server server1 on node node1 of cell MyCell. The following
script commands generate a short format dump of that server's local
namespace:
set mbean [$AdminControl completeObjectName WebSphere:*,type=NameServer,cell=MyCell,node=node1,process=server1]
$AdminControl invoke $mbean dumpLocalNameSpace {{-report short}}
- Using Jython to dump java:, local: or server namespaces
- Assume you want to use Jython to run the NameServer MBean methods
that dump java:, local: or server namespaces
for the server server1 on node node1.
The following script commands
set the NameServer instance that you want to invoke to nameServerString and
then dump a java: namespace for DefaultApplication:
nameServerString = AdminControl.completeObjectName("WebSphere:type=NameServer,node=node1,process=server1,*")
print AdminControl.invoke(nameServerString, "dumpJavaNameSpace",
'[DefaultApplication Increment.jar Increment "-report long"]')
The following script commands set the NameServer instance
that you want to invoke to nameServerString and then
dump a local: namespace:
nameServerString = AdminControl.completeObjectName("WebSphere:type=NameServer,node=node1,process=server1,*")
print AdminControl.invoke(nameServerString, "dumpLocalNameSpace", '["-report short"]')
The following script commands set the NameServer instance
that you want to invoke to nameServerString and then
dump a server namespace:
nameServerString = AdminControl.completeObjectName("WebSphere:type=NameServer,node=node1,process=server1,*")
print AdminControl.invoke(nameServerString, "dumpServerNameSpace", '["-root server"]')