IBM Websphere - 用于AutoDeployment的wsadmin脚本中的例外

时间:2012-10-08 11:00:43

标签: websphere jython web-deployment ear wsadmin

我正在尝试编写一个简单的Jython脚本来自动部署IBM Websphere Application Server上的Web应用程序。但是,我是Python的新手,所以我无法理解,为什么我会成为以下错误:

WASX7209I: Connected to process "dmgr" on node was7CellManager01 using SOAP connector;  The type of process is: DeploymentManager
WASX7017E: Exception received while running file "deploy_test.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 14, in ?
TypeError: sequence subscript must be integer or slice


我的剧本:

appname='name'
source='app.ear'
nodeName='was7Node01'
cell='was7Cell01'
server='server1'
contextRoot='/deploymenttest'

    # 1. node
    # 2. cell
    # 3. server
    # 4. Application Name
    # 5. ContextRoot
    # 5. JNDI target name 
attrs = [
         '-node ', nodeName,
         ' -cell ', cell,
         ' -server ', server,
         ' -appname ', appname,
         ' -CtxRootForWebMod ', contextRoot,
         ' -MapResRefToEJB ', [
                               [ 
                                 appname,"",
                                 source+',WEB-INF/web.xml',
                                 'jdbc/appdb','javax.sql.DataSource',
                                 'jbdc/app22','DefaultPrincipalMapping',
                                 'was7CellManager01/db2inst1',""
                               ]
                               [
                                 appname,"",
                                 source+',WEB-INF/web.xml',
                                 'jdbc/app1db','javax.sql.DataSource',
                                 'jbdc/app22','DefaultPrincipalMapping',
                                 'was7CellManager01/db2inst1',""
                               ]
                             ] 
         ]

AdminApp.install(source, attrs)


有什么想法吗?

非常感谢你。

1 个答案:

答案 0 :(得分:2)

在第27行的两个MapResRefToEJB值之间缺少逗号。