简体   繁体   中英

How do I import AdminControl in WebSphere's jython?

When running websphere's Jython I'm not able to call the AdminControl command

Jython 2.1 on java1.6.0 (JIT: j9jit26)
Type "copyright", "credits" or "license" for more information.
>>> cellName = AdminControl.getCell()
Traceback (innermost last):
  File "<console>", line 1, in ?
NameError: AdminControl

I haven't seen anything from IBM or elsewhere that indicates AdminControl needs to be imported so I'm not sure why the above doesn't work.

Notes
WebSphere 8.5
I'm running jython with the command:

"$WAS_8_5_HOME"/java/jre/bin/java.exe -jar "$WAS_8_5_HOME"/optionalLibraries/jython/jython.jar

You can't. The AdminControl object is backed by an internal type, and it is registered by wsadmin when it starts. The only way to use it is via wsadmin -lang jython (possibly with -f script.py ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM