bkail is on the right track. You need to make sure your search string is correct. Use:
print AdminControl.queryNames('type=Server,*')
in an interactive wsadmin.sh session to list all of the running servers in your cell. Then use:
'type=Server,name=JVM_NAME,*'
for your search string. Where JVM_NAME is determined from the ouput from the queryNames you just ran.
Also, I'd avoid AdminControl.completeObjectName. I'm not sure of the implications, but this snippet from the doc leads me to think it may not do what you think it does:
Use the completeObjectName command to
create a string representation of a
complete ObjectName value that is
based on a fragment. This command does
not communicate with the server to
find a matching ObjectName value. If
the system finds several MBeans that
match the fragment, the command
returns the first one.
Here's how IBM does it in WAS_ROOT/scriptLibraries/servers/V70/AdminServerManagement.py (lines 814-815):
runningServer = AdminControl.queryNames("type=Server,node="+nodeName+",name="+serverName+",*")
if (len(runningServer) > 0 and AdminControl.getAttribute(runningServer, "state") == "STARTED"):
...
In my experience, AdminControl.queryNames will only return running servers. So, depending on your needs just checking the return value of len(runningServer) may be sufficient. Also, in true IBM fashion there is nothing in the docs that list the possible return values of AdminControl.getAttribute(runningServer, "state"). I've only been able to find references to 'STARTED'.