Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Jython, Python, maybe Java question

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

DanceLikeAMon...
World Chat Champion



Joined: 24 Sep 2004
Karma :

PostPosted: 09:34 - 30 Dec 2011    Post subject: Jython, Python, maybe Java question Reply with quote

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!
 Back to top
View user's profile Send private message You must be logged in to rate posts

Frost
World Chat Champion



Joined: 26 May 2004
Karma :

PostPosted: 16:45 - 30 Dec 2011    Post subject: Reply with quote

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?
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

DanceLikeAMon...
World Chat Champion



Joined: 24 Sep 2004
Karma :

PostPosted: 21:02 - 30 Dec 2011    Post subject: Reply with quote

Evening! Yeah appdeploy is getting a value I used the same script to update other attributes and it works fine, it's just this particular attribute that has the problem.

Finished work until the new year now, but I'll give you changes a try when I return and see how it goes, thanks.
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 14 years, 294 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.08 Sec - Server Load: 0.91 - MySQL Queries: 13 - Page Size: 37.63 Kb