 DanceLikeAMon... World Chat Champion

Joined: 24 Sep 2004 Karma :   
|
 Posted: 09:34 - 30 Dec 2011 Post subject: Jython, Python, maybe Java question |
 |
|
Hey chums, I apologise in advance for this question, but I'm stuck at work and can't for the life of me work this out. I've tried the IBM forums but have had no joy (or answers!) from them, so thought I'd give this place a shot to prove their skills.
Right, apologies out the way, here's the issue:
I have no Jython or Java knowledge, but am in the process of writing a Jython script that will update some of our Websphere application values and 95% of it is is fine, just when I try to update a specific attribute I get this error which means nothing to me:
| Quote: | WASX7353E: The value of the attribute "properties" must be a collection of objects of type "Property"; an additional set of braces may be required to signify that this is a collection. |
This is the attribute I am trying to assign a value to:
| Quote: | properties Property(TypedProperty, DescriptiveProperty)* |
And this is how I am attempting it (and what is throwing out that error when being ran)
| Quote: | deployments = AdminConfig.getid('/Deployment:Myapplication/')
appDeploy = AdminConfig.showAttribute(deployments, 'deployedObject')
prop1 = [ 'name', 'test' ]
custpropstmp1 = ['Property', prop1]
custpropstmp2 = ['properties',custpropstmp1]
sessionManagerDetailList = [custpropstmp2]
sessionMgr = [['sessionManagement', sessionManagerDetailList]]
AdminConfig.create('ApplicationConfig', appDeploy, sessionMgr) |
Anyone got any clue what the issue is and how to fix it? The same script works fine for the other attributes I am updating (I cut those bits our for brevity) so it's obviously something specific to this attribute being made up of a collection.
Karma, and a manly handshake to anyone who comes up with the answer! |
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
 Posted: 16:45 - 30 Dec 2011 Post subject: |
 |
|
First try printing appDeploy to make sure it contains something:
print appDeploy
| Code: | deployments = AdminConfig.getid('/Deployment:Myapplication/')
appDeploy = AdminConfig.showAttribute(deployments, 'deployedObject')
prop1 = [ 'name', 'test' ]
custpropstmp1 = ['Property', [prop1]]
custpropstmp2 = ['properties',[custpropstmp1]]
sessionManagerDetailList = [custpropstmp2]
sessionMgr = [['sessionManagement', sessionManagerDetailList]]
AdminConfig.create('ApplicationConfig', appDeploy, sessionMgr) |
Try that? |
|
 DanceLikeAMon... World Chat Champion

Joined: 24 Sep 2004 Karma :   
|
|