Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AdminTask error

Posted on 2010-09-22
4
Medium Priority
?
1,622 Views
Last Modified: 2013-12-10
The direct Admintask command works for me

AdminTask.addMemberToGroup('[-memberUniqueName uid=xyz,o=defaultWIMFileBasedRealm -groupUniqueName cn=admins,o=defaultWIMFileBasedRealm]')

but when i try to use it as a Jython list it does not

AdminTask.addMemberToGroup(['-memberUniqueName', 'uid=%s','o=defaultWIMFileBasedRealm','-groupUniqueName','cn=%s','o=defaultWIMFileBasedRealm']) %(info[0],info[5])


com.ibm.ws.scripting.ScriptingException: WASX8009E: Invalid parameter: [Ljava.lang.Object;@53ac53ac


Even when i use it as Jython string it gives error.
AdminTask.addMemberToGroup('[-memberUniqueName uid=%s,o=defaultWIMFileBasedRealm -groupUniqueName cn=%s,o=defaultWIMFileBasedRealm]') %(info[0],info[5])


CWWIM4001E The 'uid=%s,o=defaultWIMFileBasedRealm' entity

This is happening only for this particular command , all other AdminTask commands are working when using it as a Jython list


I am using this as the reference

http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.zseries.doc/info/zseries/ae/rxml_atwimmgt.html

Experts  !  Any help is greatly appreciated,


0
Comment
Question by:wasadmin11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 41

Accepted Solution

by:
HonorGod earned 2000 total points
ID: 33734256
The command fails because the string format operator (i.e., the %) isn't being used correctly.

It needs to be used like this:

formatString % variable(s)

For example:

'uid=%s' % info[0]

or

'uid=%s ... cn=%s' % %( info[ 0 ], info[ 5 ] )

So, change this line:
 
AdminTask.addMemberToGroup('[-memberUniqueName uid=%s,o=defaultWIMFileBasedRealm -groupUniqueName cn=%s,o=defaultWIMFileBasedRealm]') %(info[0],info[5])

To this:


AdminTask.addMemberToGroup( '[-memberUniqueName uid=%s,o=defaultWIMFileBasedRealm -groupUniqueName cn=%s,o=defaultWIMFileBasedRealm]' % ( info[ 0 ], info[ 5 ] ) );

Open in new window

0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33734268
Sorry for the typo in the 2nd example... (sigh)

'uid=%s ... cn=%s' % %( info[ 0 ], info[ 5 ] )

Should actually be:

'uid=%s ... cn=%s' % ( info[ 0 ], info[ 5 ] )
0
 
LVL 2

Author Closing Comment

by:wasadmin11
ID: 33734504
Thanks for the quick response :-) and excellent solution
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 33735042
Super.  I'm happy to have been able to help.

Thanks for the grade & points.

Good luck & have a great day.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question