dumpServerNameSpace failing in JYTHON, but it works in JACL
 Technote (troubleshooting)
 
Problem(Abstract)
dumpServerNameSpace does not function in JYTHON equivalence. As efforts to migrate JACL to Jython, we found the dumpServerNameSpace does not behave the same as JACL equivalent.


JACL CODE works:
set namlist [$AdminControl invoke $nameservers dumpServerNameSpace {{}}]



JYTHON failed:
namelist = AdminControl.invoke(nameservers, "dumpServerNameSpace", [[]])
 
Cause
JACL to JYTHON conversion in IBM® WebSphere® Application Server
 
Resolving the problem
Here is the failure message shows at command line:
WASADMIN Jython test:                                            
nameservers = AdminControl.queryNames("*:*,type=NameServer,  process=server1")                                
print nameservers
                                               
wsadmin>namelist = AdminControl.invoke(nameservers, "dumpServerNameSpace", [[]])                                                                   
WASX7015E: Exception running command: "data = AdminControl.invoke      
(nameservers, "dumpServerNameSpace", [[]])"; exception information:    com.ibm.bsf.BSFException: exception from Jython: Traceback (innermost last):                                                                  File "<input>", line 1, in ?TypeError: invoke(): 3rd arg can't be coerced to String     

The language JYTHON expects the values to be passed as string. Since, the last parameter is enclosed within doubles quotes JYTHON assumes it as variable and tries to substitute with its string, but fails so it throws the exception. Here is the correct usage of the command.

Solutions to jacl to jython:

nameservers = AdminControl.queryNames("*:*,type=NameServer,process=server1")
print nameservers
namelist = AdminControl.invoke(nameservers, "dumpServerNameSpace", "[[]]")    
print namelist
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Administrative Scripting Tools (for example: wsadmin or ANT)
Operating system(s): Windows
Software version: 6.0.2
Software edition:
Reference #: 1239506
IBM Group: Software Group
Modified date: Sep 29, 2006