0
我想在Jython中創建一個腳本來將一些應用程序從7遷移到8.5。在我創建數據源後,我被約2小時的這個錯誤卡住了:TypeError:序列下標必須是整數或分片WSadmin TypeError:序列下標必須是整數或切片使用AdminConfig.modify
問題出現在第25行,我不知道如何解決它。如果您需要更多信息,請告訴我。 請幫幫我!非常感謝你!
我的代碼:
if (len(OracleDataSourceList) > 0):
dbuserList=AdminTask.listAuthDataEntries()
for dataSource in OracleDataSourceList:
datasourceName=dataSource[0]
dsJNDIName=dataSource[1]
compAuthAlias=dataSource[2]
providerName=dataSource[3]
dataStoreHelperClassName=dataSource[4]
description=dataSource[5]
databaseURL=dataSource[6]
databaseMaxConnections=dataSource[7]
databaseMinConnections=dataSource[8]
databaseconnTimeout=dataSource[9]
databasereapTime=dataSource[10]
databaseunusedTimeout=dataSource[11]
databaseagedTimeout=dataSource[12]
#Create Data Source
dataSourceId = AdminJDBC.createDataSourceAtScope(scope, providerName, datasourceName, dsJNDIName, dataStoreHelperClassName, databaseURL, [['componentManagedAuthenticationAlias',compAuthAlias],['containerManagedPersistence','true'],['description',description]])
#Modify connection pool
connectionPoolList = AdminConfig.list('ConnectionPool', dataSourceId)
connectionPoolList = AdminUtilities.convertToList(connectionPoolList)
connectionPoolId = connectionPoolList[0]
AdminConfig.modify(connectionPoolId, [["maxConnections", databaseMaxConnections]\
["minConnections", databaseMinConnections]\
["connTimeout", databaseconnTimeout]\
["reapTime", databasereapTime]\
["unusedTimeout", databaseunusedTimeout]\
["agedTimeout", databaseagedTimeout]\
])
print 'Saving configuration...'
AdminConfig.save()
print "Configuration saved."
錯誤:
WASX7017E: Exception received while running file "createDataSource.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 25, in ?
TypeError: sequence subscript must be integer or slice