Problem with wsadmin, jython & attribute value contain:"[comma][apostrop]" - Websphere

This is a discussion on Problem with wsadmin, jython & attribute value contain:"[comma][apostrop]" - Websphere ; Hello, I'm facing a strange problem with WAS 6.1.0.21 and wsadmin tool. I have a script in jython that sets some attrubite value to i.e. "problematic,'' one". When I read this attribute value (i.e. in administration console) I get "problematic ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Problem with wsadmin, jython & attribute value contain:"[comma][apostrop]"

  1. Problem with wsadmin, jython & attribute value contain:"[comma][apostrop]"

    Hello,

    I'm facing a strange problem with WAS 6.1.0.21 and wsadmin tool. I have a script in jython that sets some attrubite value to i.e. "problematic,'' one". When I read this attribute value (i.e. in administration console) I get "problematic '' one". WAS seems to change "[comma][apostrophe]" to "[space][apostrophe]". Can anyone tell me why and how to make this work?


    customUserRegistryId = AdminConfig.getid('/Security:/CustomUserRegistry:/')
    AdminConfig.modify(customUserRegistryId, [['realm', "problematic,'' one"]])


    Thanks,
    Tomasz Lewandowski

  2. Re: Problem with wsadmin, jython & attribute value contain:"[comma][apostr

    As you can see, the forum didn't like what you had typed for the 2nd modify parameter... :-)

    Is the value that you are trying to use a string containing double quotes?

    Can you attach a text file containing the code that you are trying to use?

  3. Re: Problem with wsadmin, jython & attribute value contain:"[comma][apostr

    I attached the code.
    I also tried to write this string literal using single quotes (with escaping inner apostrophes with backslash) and with triple apostrophes. I also confirmed that this is not python language problem, because print command print the string properly.

  4. Re: Problem with wsadmin, jython & attribute value contain:"[comma][apostr

    Thanks for the code snippet.

    The more I play with it, the more it looks like the value isn't allowed to have a comma in it. As you indicated, the comma is being replaced by a space. Why do you need the realm custom property to have a comma in it?

  5. Re: Problem with wsadmin, jython & attribute value contain:"[comma][apostr

    Well, the "realm" attribute is just an example. In fact I have a custom property of my CustomUserRegistry which value is an SQL statement that retrives user by login and I don't want to change the statement. Is it a bug in WAS or what?

  6. Re: Problem with wsadmin, jython & attribute value contain:"[comma][apostr

    To me it looks like a bug - handling commas in an attribute string. In the following the whitespace is lost.

    {code}"problematic, ,one"{code}

    //Stephen

+ Reply to Thread