0

我正在尝试编写一个简单的 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)


有任何想法吗?

非常感谢您提前。

4

1 回答 1

2

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

于 2012-10-08T12:12:58.193 回答