我在使用Jython的代码中遇到语法错误。任何人都可以说语法有什么问题吗?我是这种语言的新手,没有太多想法。
错误讯息:
我的代码:
import sys
nodeName =sys.argv[0]
serverName =sys.argv[1]
profilePath=sys.argv[2]
machineName=sys.argv[3]
def createNamespaceBinding(nodeName,serverName,profilePath,machineName):
print "Creating NamespaceBinding"
ds = AdminConfig.getid("/Node:"+nodeName+"/Server:"+serverName+"/" )
AdminTask.setJVMSystemProperties('[-serverName '+serverName+' -nodeName '+nodeName+' -propertyName com.ibm.websphere.management.configservice.validatePropNames -propertyValue false]')
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'auditlogJmsConcurrency'],['nameInNameSpace', 'auditlogJmsConcurrency'], ['stringToBind', "4"]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'campaignStatisticsOutputDirectory'],['nameInNameSpace', 'campaignStatisticsOutputDirectory'], ['stringToBind', profilePath]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'cardImagepath'],['nameInNameSpace', 'cardImagepath'], ['stringToBind', profilePath]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'crmInputDirectory'],['nameInNameSpace', 'crmInputDirectory'], ['stringToBind', profilePath]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'crmOutputDirectory'],['nameInNameSpace', 'crmOutputDirectory'], ['stringToBind', profilePath]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'doAuditlog'],['nameInNameSpace', 'doAuditlog'], ['stringToBind', 'wm']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'elasticsearchClusterName'],['nameInNameSpace', 'elasticsearchClusterName'], ['stringToBind', machineName]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'elasticsearchHost'],['nameInNameSpace', 'elasticsearchHost'], ['stringToBind', machineName]])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'elasticsearchIndexName'],['nameInNameSpace', 'elasticsearchIndexName'], ['stringToBind', 'pegasus2']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'elasticsearchPort'],['nameInNameSpace', 'elasticsearchPort'], ['stringToBind', '9300']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'iframeIntegrationTestApplicationBaseUrlOnThePegasusSideOfProxy'],['nameInNameSpace', 'iframeIntegrationTestApplicationBaseUrlOnThePegasusSideOfProxy'], ['stringToBind', 'http://DCR4VM:8080/misys/']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'NetbankSrvURL'],['nameInNameSpace', 'NetbankSrvURL'], ['stringToBind', 'iiop://localhost:2814']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'pegasusLogbackCorexmlUrl'],['nameInNameSpace', 'pegasusLogbackCorexmlUrl'], ['stringToBind', 'file:'+profilePath+'\logs\logbackMain.xml']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'pegasusSsoProviderRetrievePrincipalUrl'],['nameInNameSpace', 'pegasusSsoProviderRetrievePrincipalUrl'], ['stringToBind', 'http://localhost:9085/foundation-guiwar/pegasus/ssoprovider/retrievePrincipal']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/account'],['nameInNameSpace', 'integration/endpoint/account'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/card'],['nameInNameSpace', 'integration/endpoint/card'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/chequebook'],['nameInNameSpace', 'integration/endpoint/chequebook'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/customer'],['nameInNameSpace', 'integration/endpoint/customer'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/investment'],['nameInNameSpace', 'integration/endpoint/investment'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/loan'],['nameInNameSpace', 'integration/endpoint/loan'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/notificationsettings'],['nameInNameSpace', 'integration/endpoint/notificationsettings'], ['stringToBind', 'http://dcr4vm:9084/OnlineInvestmentWS']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/productlist'],['nameInNameSpace', 'integration/endpoint/productlist'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/standingorder'],['nameInNameSpace', 'integration/endpoint/standingorder'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/statement'],['nameInNameSpace', 'integration/endpoint/statement'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/termdeposit'],['nameInNameSpace', 'integration/endpoint/termdeposit'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/transaction'],['nameInNameSpace', 'integration/endpoint/transaction'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
AdminConfig.create('StringNameSpaceBinding', ds, [['name', 'integration/endpoint/transfer'],['nameInNameSpace', 'integration/endpoint/transfer'], ['stringToBind', 'http://localhost:9085/backend-emulator-war']])
AdminConfig.save()
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Main program
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
createNamespaceBinding(nodeName,serverName,profilePath,machineName)
我已经添加了对setJVMSystemProperties()的调用,因此它将忽略name属性中的'/',但仍然面临问题。