【发布时间】:2015-08-26 14:38:21
【问题描述】:
我正在尝试通过 Jython 脚本访问 Admin 对象,以便更新部署到 WebSphere Application Server 的 Maven 应用程序,而无需每次进行更改时都通过集成解决方案控制台。我的问题很简单:我知道在访问 Admin 对象后如何调用命令,但我很难做到这一点。进入服务器配置文件的 bin 文件夹后,是否需要将它们分配给对象,还是可以直接调用它们?具体来说,我将如何做到这一点?这是我现在拥有的代码:
#!usr/bin/local/python
import sys
import os
try:
serverPath = 'c:\IBM\WebSphere8\AppServerND\profiles\\WAS8\\bin\\'
os.chdir(serverPath)
print AdminApp.listModules('restreportscore-application')
except:
e = sys.exc_info()[0]
print( "Error: %s" % e )
endSelect = raw_input("Press Enter to continue...")
但它会抛出“exceptions.NameError”类型的错误。
【问题讨论】: